YES(O(1),O(n^2)) We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^2)). Strict Trs: { #abs(#0()) -> #0() , #abs(#neg(@x)) -> #pos(@x) , #abs(#pos(@x)) -> #pos(@x) , #abs(#s(@x)) -> #pos(#s(@x)) , #equal(@x, @y) -> #eq(@x, @y) , #greater(@x, @y) -> #ckgt(#compare(@x, @y)) , #less(@x, @y) -> #cklt(#compare(@x, @y)) , *(@x, @y) -> #mult(@x, @y) , +(@x, @y) -> #add(@x, @y) , -(@x, @y) -> #sub(@x, @y) , add(@b1, @b2) -> add'(@b1, @b2, #abs(#0())) , add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r) , add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs) , add'#1(nil(), @b2, @r) -> nil() , add'#2(::(@y, @ys), @r, @x, @xs) -> add'#3(sum(@x, @y, @r), @xs, @ys) , add'#2(nil(), @r, @x, @xs) -> nil() , sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r)) , add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r')) , bitToInt(@b) -> bitToInt'(@b, #abs(#pos(#s(#0())))) , bitToInt'(@b, @n) -> bitToInt'#1(@b, @n) , bitToInt'#1(::(@x, @xs), @n) -> +(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))) , bitToInt'#1(nil(), @n) -> #abs(#0()) , compare(@b1, @b2) -> compare#1(@b1, @b2) , compare#1(::(@x, @xs), @b2) -> compare#2(@b2, @x, @xs) , compare#1(nil(), @b2) -> #abs(#0()) , compare#2(::(@y, @ys), @x, @xs) -> compare#3(compare(@xs, @ys), @x, @y) , compare#2(nil(), @x, @xs) -> #abs(#0()) , compare#3(@r, @x, @y) -> compare#4(#equal(@r, #0()), @r, @x, @y) , compare#4(#false(), @r, @x, @y) -> @r , compare#4(#true(), @r, @x, @y) -> compare#5(#less(@x, @y), @x, @y) , compare#5(#false(), @x, @y) -> compare#6(#greater(@x, @y)) , compare#5(#true(), @x, @y) -> -(#0(), #pos(#s(#0()))) , compare#6(#false()) -> #abs(#0()) , compare#6(#true()) -> #abs(#pos(#s(#0()))) , diff(@x, @y, @r) -> tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))), diff#1(#less(-(-(@x, @y), @r), #0()))) , mod(@x, @y) -> -(@x, *(@y, div(@x, @y))) , diff#1(#false()) -> #abs(#0()) , diff#1(#true()) -> #abs(#pos(#s(#0()))) , div(@x, @y) -> #div(@x, @y) , leq(@b1, @b2) -> #less(compare(@b1, @b2), #pos(#s(#0()))) , mult(@b1, @b2) -> mult#1(@b1, @b2) , mult#1(::(@x, @xs), @b2) -> mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x) , mult#1(nil(), @b2) -> nil() , mult#2(@zs, @b2, @x) -> mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs) , mult#3(#false(), @b2, @zs) -> @zs , mult#3(#true(), @b2, @zs) -> add(@b2, @zs) , mult3(@b1, @b2, @b3) -> mult(mult(@b1, @b2), @b2) , sub(@b1, @b2) -> sub#1(sub'(@b1, @b2, #abs(#0()))) , sub'(@b1, @b2, @r) -> sub'#1(@b1, @b2, @r) , sub#1(tuple#2(@b, @_@1)) -> @b , sub'#1(::(@x, @xs), @b2, @r) -> sub'#2(@b2, @r, @x, @xs) , sub'#1(nil(), @b2, @r) -> tuple#2(nil(), @r) , sub'#2(::(@y, @ys), @r, @x, @xs) -> sub'#3(diff(@x, @y, @r), @xs, @ys) , sub'#2(nil(), @r, @x, @xs) -> tuple#2(nil(), @r) , sub'#3(tuple#2(@z, @r'), @xs, @ys) -> sub'#4(sub'(@xs, @ys, @r'), @z) , sub'#4(tuple#2(@zs, @s), @z) -> tuple#2(sub'#5(#equal(@s, #pos(#s(#0()))), @z, @zs), @s) , sub'#5(#false(), @z, @zs) -> ::(@z, @zs) , sub'#5(#true(), @z, @zs) -> ::(#abs(#0()), @zs) , sum#1(@s) -> sum#2(#equal(@s, #0()), @s) , sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s) , sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0())) , sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0()))))) , sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0())) , sum#4(#false()) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0())))) , sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0())))) } Weak Trs: { #eq(#0(), #0()) -> #true() , #eq(#0(), #neg(@y)) -> #false() , #eq(#0(), #pos(@y)) -> #false() , #eq(#0(), #s(@y)) -> #false() , #eq(#neg(@x), #0()) -> #false() , #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #pos(@y)) -> #false() , #eq(#pos(@x), #0()) -> #false() , #eq(#pos(@x), #neg(@y)) -> #false() , #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y) , #eq(#s(@x), #0()) -> #false() , #eq(#s(@x), #s(@y)) -> #eq(@x, @y) , #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #eq(::(@x_1, @x_2), nil()) -> #false() , #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false() , #eq(nil(), ::(@y_1, @y_2)) -> #false() , #eq(nil(), nil()) -> #true() , #eq(nil(), tuple#2(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), nil()) -> #false() , #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #compare(#0(), #0()) -> #EQ() , #compare(#0(), #neg(@y)) -> #GT() , #compare(#0(), #pos(@y)) -> #LT() , #compare(#0(), #s(@y)) -> #LT() , #compare(#neg(@x), #0()) -> #LT() , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x) , #compare(#neg(@x), #pos(@y)) -> #LT() , #compare(#pos(@x), #0()) -> #GT() , #compare(#pos(@x), #neg(@y)) -> #GT() , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y) , #compare(#s(@x), #0()) -> #GT() , #compare(#s(@x), #s(@y)) -> #compare(@x, @y) , #ckgt(#EQ()) -> #false() , #ckgt(#GT()) -> #true() , #ckgt(#LT()) -> #false() , #cklt(#EQ()) -> #false() , #cklt(#GT()) -> #false() , #cklt(#LT()) -> #true() , #mult(#0(), #0()) -> #0() , #mult(#0(), #neg(@y)) -> #0() , #mult(#0(), #pos(@y)) -> #0() , #mult(#neg(@x), #0()) -> #0() , #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y)) , #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #0()) -> #0() , #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y)) , #add(#0(), @y) -> @y , #add(#neg(#s(#0())), @y) -> #pred(@y) , #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y)) , #add(#pos(#s(#0())), @y) -> #succ(@y) , #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y)) , #sub(@x, #0()) -> @x , #sub(@x, #neg(@y)) -> #add(@x, #pos(@y)) , #sub(@x, #pos(@y)) -> #add(@x, #neg(@y)) , #div(#0(), #0()) -> #divByZero() , #div(#0(), #neg(@y)) -> #0() , #div(#0(), #pos(@y)) -> #0() , #div(#neg(@x), #0()) -> #divByZero() , #div(#neg(@x), #neg(@y)) -> #positive(#natdiv(@x, @y)) , #div(#neg(@x), #pos(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #0()) -> #divByZero() , #div(#pos(@x), #neg(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #pos(@y)) -> #positive(#natdiv(@x, @y)) , #pred(#0()) -> #neg(#s(#0())) , #pred(#neg(#s(@x))) -> #neg(#s(#s(@x))) , #pred(#pos(#s(#0()))) -> #0() , #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x)) , #succ(#0()) -> #pos(#s(#0())) , #succ(#neg(#s(#0()))) -> #0() , #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x)) , #succ(#pos(#s(@x))) -> #pos(#s(#s(@x))) , #and(#false(), #false()) -> #false() , #and(#false(), #true()) -> #false() , #and(#true(), #false()) -> #false() , #and(#true(), #true()) -> #true() , #natdiv(#0(), #0()) -> #divByZero() , #natdiv(#0(), #s(@y)) -> #0() , #natdiv(#s(@x), #0()) -> #divByZero() , #natdiv(#s(@x), #s(@y)) -> #natdiv'(#divsub(@x, @y), #s(@y)) , #positive(#0()) -> #0() , #positive(#neg(@x)) -> #neg(@x) , #positive(#pos(@x)) -> #pos(@x) , #positive(#s(@x)) -> #pos(#s(@x)) , #negative(#0()) -> #0() , #negative(#neg(@x)) -> #pos(@x) , #negative(#pos(@x)) -> #neg(@x) , #negative(#s(@x)) -> #neg(#s(@x)) , #divsub(#0(), #0()) -> #0() , #divsub(#0(), #s(@y)) -> #underflow() , #divsub(#s(@x), #0()) -> #s(@x) , #divsub(#s(@x), #s(@y)) -> #divsub(@x, @y) , #natmult(#0(), @y) -> #0() , #natmult(#s(@x), @y) -> #natadd(@y, #natmult(@x, @y)) , #natadd(#0(), @y) -> @y , #natadd(#s(@x), @y) -> #s(#natadd(@x, @y)) , #natdiv'(#0(), @y) -> #s(#0()) , #natdiv'(#s(@x), @y) -> #s(#natdiv(#s(@x), @y)) , #natdiv'(#underflow(), @y) -> #0() , #natsub(@x, #0()) -> @x , #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^2)) We add following dependency tuples: Strict DPs: { #abs^#(#0()) -> c_1() , #abs^#(#neg(@x)) -> c_2() , #abs^#(#pos(@x)) -> c_3() , #abs^#(#s(@x)) -> c_4() , #equal^#(@x, @y) -> c_5(#eq^#(@x, @y)) , #greater^#(@x, @y) -> c_6(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y)) , #less^#(@x, @y) -> c_7(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y)) , *^#(@x, @y) -> c_8(#mult^#(@x, @y)) , +^#(@x, @y) -> c_9(#add^#(@x, @y)) , -^#(@x, @y) -> c_10(#sub^#(@x, @y)) , add^#(@b1, @b2) -> c_11(add'^#(@b1, @b2, #abs(#0())), #abs^#(#0())) , add'^#(@b1, @b2, @r) -> c_12(add'#1^#(@b1, @b2, @r)) , add'#1^#(::(@x, @xs), @b2, @r) -> c_13(add'#2^#(@b2, @r, @x, @xs)) , add'#1^#(nil(), @b2, @r) -> c_14() , add'#2^#(::(@y, @ys), @r, @x, @xs) -> c_15(add'#3^#(sum(@x, @y, @r), @xs, @ys), sum^#(@x, @y, @r)) , add'#2^#(nil(), @r, @x, @xs) -> c_16() , add'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_18(add'^#(@xs, @ys, @r')) , sum^#(@x, @y, @r) -> c_17(sum#1^#(+(+(@x, @y), @r)), +^#(+(@x, @y), @r), +^#(@x, @y)) , sum#1^#(@s) -> c_59(sum#2^#(#equal(@s, #0()), @s), #equal^#(@s, #0())) , bitToInt^#(@b) -> c_19(bitToInt'^#(@b, #abs(#pos(#s(#0())))), #abs^#(#pos(#s(#0())))) , bitToInt'^#(@b, @n) -> c_20(bitToInt'#1^#(@b, @n)) , bitToInt'#1^#(::(@x, @xs), @n) -> c_21(+^#(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))), *^#(@x, @n), bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))), *^#(@n, #pos(#s(#s(#0()))))) , bitToInt'#1^#(nil(), @n) -> c_22(#abs^#(#0())) , compare^#(@b1, @b2) -> c_23(compare#1^#(@b1, @b2)) , compare#1^#(::(@x, @xs), @b2) -> c_24(compare#2^#(@b2, @x, @xs)) , compare#1^#(nil(), @b2) -> c_25(#abs^#(#0())) , compare#2^#(::(@y, @ys), @x, @xs) -> c_26(compare#3^#(compare(@xs, @ys), @x, @y), compare^#(@xs, @ys)) , compare#2^#(nil(), @x, @xs) -> c_27(#abs^#(#0())) , compare#3^#(@r, @x, @y) -> c_28(compare#4^#(#equal(@r, #0()), @r, @x, @y), #equal^#(@r, #0())) , compare#4^#(#false(), @r, @x, @y) -> c_29() , compare#4^#(#true(), @r, @x, @y) -> c_30(compare#5^#(#less(@x, @y), @x, @y), #less^#(@x, @y)) , compare#5^#(#false(), @x, @y) -> c_31(compare#6^#(#greater(@x, @y)), #greater^#(@x, @y)) , compare#5^#(#true(), @x, @y) -> c_32(-^#(#0(), #pos(#s(#0())))) , compare#6^#(#false()) -> c_33(#abs^#(#0())) , compare#6^#(#true()) -> c_34(#abs^#(#pos(#s(#0())))) , diff^#(@x, @y, @r) -> c_35(mod^#(+(+(@x, @y), @r), #pos(#s(#s(#0())))), +^#(+(@x, @y), @r), +^#(@x, @y), diff#1^#(#less(-(-(@x, @y), @r), #0())), #less^#(-(-(@x, @y), @r), #0()), -^#(-(@x, @y), @r), -^#(@x, @y)) , mod^#(@x, @y) -> c_36(-^#(@x, *(@y, div(@x, @y))), *^#(@y, div(@x, @y)), div^#(@x, @y)) , diff#1^#(#false()) -> c_37(#abs^#(#0())) , diff#1^#(#true()) -> c_38(#abs^#(#pos(#s(#0())))) , div^#(@x, @y) -> c_39(#div^#(@x, @y)) , leq^#(@b1, @b2) -> c_40(#less^#(compare(@b1, @b2), #pos(#s(#0()))), compare^#(@b1, @b2)) , mult^#(@b1, @b2) -> c_41(mult#1^#(@b1, @b2)) , mult#1^#(::(@x, @xs), @b2) -> c_42(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x), #abs^#(#0()), mult^#(@xs, @b2)) , mult#1^#(nil(), @b2) -> c_43() , mult#2^#(@zs, @b2, @x) -> c_44(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs), #equal^#(@x, #pos(#s(#0())))) , mult#3^#(#false(), @b2, @zs) -> c_45() , mult#3^#(#true(), @b2, @zs) -> c_46(add^#(@b2, @zs)) , mult3^#(@b1, @b2, @b3) -> c_47(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2)) , sub^#(@b1, @b2) -> c_48(sub#1^#(sub'(@b1, @b2, #abs(#0()))), sub'^#(@b1, @b2, #abs(#0())), #abs^#(#0())) , sub#1^#(tuple#2(@b, @_@1)) -> c_50() , sub'^#(@b1, @b2, @r) -> c_49(sub'#1^#(@b1, @b2, @r)) , sub'#1^#(::(@x, @xs), @b2, @r) -> c_51(sub'#2^#(@b2, @r, @x, @xs)) , sub'#1^#(nil(), @b2, @r) -> c_52() , sub'#2^#(::(@y, @ys), @r, @x, @xs) -> c_53(sub'#3^#(diff(@x, @y, @r), @xs, @ys), diff^#(@x, @y, @r)) , sub'#2^#(nil(), @r, @x, @xs) -> c_54() , sub'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_55(sub'#4^#(sub'(@xs, @ys, @r'), @z), sub'^#(@xs, @ys, @r')) , sub'#4^#(tuple#2(@zs, @s), @z) -> c_56(sub'#5^#(#equal(@s, #pos(#s(#0()))), @z, @zs), #equal^#(@s, #pos(#s(#0())))) , sub'#5^#(#false(), @z, @zs) -> c_57() , sub'#5^#(#true(), @z, @zs) -> c_58(#abs^#(#0())) , sum#2^#(#false(), @s) -> c_60(sum#3^#(#equal(@s, #pos(#s(#0()))), @s), #equal^#(@s, #pos(#s(#0())))) , sum#2^#(#true(), @s) -> c_61(#abs^#(#0()), #abs^#(#0())) , sum#3^#(#false(), @s) -> c_62(sum#4^#(#equal(@s, #pos(#s(#s(#0()))))), #equal^#(@s, #pos(#s(#s(#0()))))) , sum#3^#(#true(), @s) -> c_63(#abs^#(#pos(#s(#0()))), #abs^#(#0())) , sum#4^#(#false()) -> c_64(#abs^#(#pos(#s(#0()))), #abs^#(#pos(#s(#0())))) , sum#4^#(#true()) -> c_65(#abs^#(#0()), #abs^#(#pos(#s(#0())))) } Weak DPs: { #eq^#(#0(), #0()) -> c_66() , #eq^#(#0(), #neg(@y)) -> c_67() , #eq^#(#0(), #pos(@y)) -> c_68() , #eq^#(#0(), #s(@y)) -> c_69() , #eq^#(#neg(@x), #0()) -> c_70() , #eq^#(#neg(@x), #neg(@y)) -> c_71(#eq^#(@x, @y)) , #eq^#(#neg(@x), #pos(@y)) -> c_72() , #eq^#(#pos(@x), #0()) -> c_73() , #eq^#(#pos(@x), #neg(@y)) -> c_74() , #eq^#(#pos(@x), #pos(@y)) -> c_75(#eq^#(@x, @y)) , #eq^#(#s(@x), #0()) -> c_76() , #eq^#(#s(@x), #s(@y)) -> c_77(#eq^#(@x, @y)) , #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) -> c_78(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)), #eq^#(@x_1, @y_1), #eq^#(@x_2, @y_2)) , #eq^#(::(@x_1, @x_2), nil()) -> c_79() , #eq^#(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> c_80() , #eq^#(nil(), ::(@y_1, @y_2)) -> c_81() , #eq^#(nil(), nil()) -> c_82() , #eq^#(nil(), tuple#2(@y_1, @y_2)) -> c_83() , #eq^#(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> c_84() , #eq^#(tuple#2(@x_1, @x_2), nil()) -> c_85() , #eq^#(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> c_86(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)), #eq^#(@x_1, @y_1), #eq^#(@x_2, @y_2)) , #ckgt^#(#EQ()) -> c_99() , #ckgt^#(#GT()) -> c_100() , #ckgt^#(#LT()) -> c_101() , #compare^#(#0(), #0()) -> c_87() , #compare^#(#0(), #neg(@y)) -> c_88() , #compare^#(#0(), #pos(@y)) -> c_89() , #compare^#(#0(), #s(@y)) -> c_90() , #compare^#(#neg(@x), #0()) -> c_91() , #compare^#(#neg(@x), #neg(@y)) -> c_92(#compare^#(@y, @x)) , #compare^#(#neg(@x), #pos(@y)) -> c_93() , #compare^#(#pos(@x), #0()) -> c_94() , #compare^#(#pos(@x), #neg(@y)) -> c_95() , #compare^#(#pos(@x), #pos(@y)) -> c_96(#compare^#(@x, @y)) , #compare^#(#s(@x), #0()) -> c_97() , #compare^#(#s(@x), #s(@y)) -> c_98(#compare^#(@x, @y)) , #cklt^#(#EQ()) -> c_102() , #cklt^#(#GT()) -> c_103() , #cklt^#(#LT()) -> c_104() , #mult^#(#0(), #0()) -> c_105() , #mult^#(#0(), #neg(@y)) -> c_106() , #mult^#(#0(), #pos(@y)) -> c_107() , #mult^#(#neg(@x), #0()) -> c_108() , #mult^#(#neg(@x), #neg(@y)) -> c_109(#natmult^#(@x, @y)) , #mult^#(#neg(@x), #pos(@y)) -> c_110(#natmult^#(@x, @y)) , #mult^#(#pos(@x), #0()) -> c_111() , #mult^#(#pos(@x), #neg(@y)) -> c_112(#natmult^#(@x, @y)) , #mult^#(#pos(@x), #pos(@y)) -> c_113(#natmult^#(@x, @y)) , #add^#(#0(), @y) -> c_114() , #add^#(#neg(#s(#0())), @y) -> c_115(#pred^#(@y)) , #add^#(#neg(#s(#s(@x))), @y) -> c_116(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) , #add^#(#pos(#s(#0())), @y) -> c_117(#succ^#(@y)) , #add^#(#pos(#s(#s(@x))), @y) -> c_118(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) , #sub^#(@x, #0()) -> c_119() , #sub^#(@x, #neg(@y)) -> c_120(#add^#(@x, #pos(@y))) , #sub^#(@x, #pos(@y)) -> c_121(#add^#(@x, #neg(@y))) , #div^#(#0(), #0()) -> c_122() , #div^#(#0(), #neg(@y)) -> c_123() , #div^#(#0(), #pos(@y)) -> c_124() , #div^#(#neg(@x), #0()) -> c_125() , #div^#(#neg(@x), #neg(@y)) -> c_126(#positive^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) , #div^#(#neg(@x), #pos(@y)) -> c_127(#negative^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) , #div^#(#pos(@x), #0()) -> c_128() , #div^#(#pos(@x), #neg(@y)) -> c_129(#negative^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) , #div^#(#pos(@x), #pos(@y)) -> c_130(#positive^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) , #and^#(#false(), #false()) -> c_139() , #and^#(#false(), #true()) -> c_140() , #and^#(#true(), #false()) -> c_141() , #and^#(#true(), #true()) -> c_142() , #natmult^#(#0(), @y) -> c_159() , #natmult^#(#s(@x), @y) -> c_160(#natadd^#(@y, #natmult(@x, @y)), #natmult^#(@x, @y)) , #pred^#(#0()) -> c_131() , #pred^#(#neg(#s(@x))) -> c_132() , #pred^#(#pos(#s(#0()))) -> c_133() , #pred^#(#pos(#s(#s(@x)))) -> c_134() , #succ^#(#0()) -> c_135() , #succ^#(#neg(#s(#0()))) -> c_136() , #succ^#(#neg(#s(#s(@x)))) -> c_137() , #succ^#(#pos(#s(@x))) -> c_138() , #positive^#(#0()) -> c_147() , #positive^#(#neg(@x)) -> c_148() , #positive^#(#pos(@x)) -> c_149() , #positive^#(#s(@x)) -> c_150() , #natdiv^#(#0(), #0()) -> c_143() , #natdiv^#(#0(), #s(@y)) -> c_144() , #natdiv^#(#s(@x), #0()) -> c_145() , #natdiv^#(#s(@x), #s(@y)) -> c_146(#natdiv'^#(#divsub(@x, @y), #s(@y)), #divsub^#(@x, @y)) , #negative^#(#0()) -> c_151() , #negative^#(#neg(@x)) -> c_152() , #negative^#(#pos(@x)) -> c_153() , #negative^#(#s(@x)) -> c_154() , #natdiv'^#(#0(), @y) -> c_163() , #natdiv'^#(#s(@x), @y) -> c_164(#natdiv^#(#s(@x), @y)) , #natdiv'^#(#underflow(), @y) -> c_165() , #divsub^#(#0(), #0()) -> c_155() , #divsub^#(#0(), #s(@y)) -> c_156() , #divsub^#(#s(@x), #0()) -> c_157() , #divsub^#(#s(@x), #s(@y)) -> c_158(#divsub^#(@x, @y)) , #natadd^#(#0(), @y) -> c_161() , #natadd^#(#s(@x), @y) -> c_162(#natadd^#(@x, @y)) , #natsub^#(@x, #0()) -> c_166() , #natsub^#(#s(@x), #s(@y)) -> c_167(#natsub^#(@x, @y)) } and mark the set of starting terms. We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^2)). Strict DPs: { #abs^#(#0()) -> c_1() , #abs^#(#neg(@x)) -> c_2() , #abs^#(#pos(@x)) -> c_3() , #abs^#(#s(@x)) -> c_4() , #equal^#(@x, @y) -> c_5(#eq^#(@x, @y)) , #greater^#(@x, @y) -> c_6(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y)) , #less^#(@x, @y) -> c_7(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y)) , *^#(@x, @y) -> c_8(#mult^#(@x, @y)) , +^#(@x, @y) -> c_9(#add^#(@x, @y)) , -^#(@x, @y) -> c_10(#sub^#(@x, @y)) , add^#(@b1, @b2) -> c_11(add'^#(@b1, @b2, #abs(#0())), #abs^#(#0())) , add'^#(@b1, @b2, @r) -> c_12(add'#1^#(@b1, @b2, @r)) , add'#1^#(::(@x, @xs), @b2, @r) -> c_13(add'#2^#(@b2, @r, @x, @xs)) , add'#1^#(nil(), @b2, @r) -> c_14() , add'#2^#(::(@y, @ys), @r, @x, @xs) -> c_15(add'#3^#(sum(@x, @y, @r), @xs, @ys), sum^#(@x, @y, @r)) , add'#2^#(nil(), @r, @x, @xs) -> c_16() , add'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_18(add'^#(@xs, @ys, @r')) , sum^#(@x, @y, @r) -> c_17(sum#1^#(+(+(@x, @y), @r)), +^#(+(@x, @y), @r), +^#(@x, @y)) , sum#1^#(@s) -> c_59(sum#2^#(#equal(@s, #0()), @s), #equal^#(@s, #0())) , bitToInt^#(@b) -> c_19(bitToInt'^#(@b, #abs(#pos(#s(#0())))), #abs^#(#pos(#s(#0())))) , bitToInt'^#(@b, @n) -> c_20(bitToInt'#1^#(@b, @n)) , bitToInt'#1^#(::(@x, @xs), @n) -> c_21(+^#(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))), *^#(@x, @n), bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))), *^#(@n, #pos(#s(#s(#0()))))) , bitToInt'#1^#(nil(), @n) -> c_22(#abs^#(#0())) , compare^#(@b1, @b2) -> c_23(compare#1^#(@b1, @b2)) , compare#1^#(::(@x, @xs), @b2) -> c_24(compare#2^#(@b2, @x, @xs)) , compare#1^#(nil(), @b2) -> c_25(#abs^#(#0())) , compare#2^#(::(@y, @ys), @x, @xs) -> c_26(compare#3^#(compare(@xs, @ys), @x, @y), compare^#(@xs, @ys)) , compare#2^#(nil(), @x, @xs) -> c_27(#abs^#(#0())) , compare#3^#(@r, @x, @y) -> c_28(compare#4^#(#equal(@r, #0()), @r, @x, @y), #equal^#(@r, #0())) , compare#4^#(#false(), @r, @x, @y) -> c_29() , compare#4^#(#true(), @r, @x, @y) -> c_30(compare#5^#(#less(@x, @y), @x, @y), #less^#(@x, @y)) , compare#5^#(#false(), @x, @y) -> c_31(compare#6^#(#greater(@x, @y)), #greater^#(@x, @y)) , compare#5^#(#true(), @x, @y) -> c_32(-^#(#0(), #pos(#s(#0())))) , compare#6^#(#false()) -> c_33(#abs^#(#0())) , compare#6^#(#true()) -> c_34(#abs^#(#pos(#s(#0())))) , diff^#(@x, @y, @r) -> c_35(mod^#(+(+(@x, @y), @r), #pos(#s(#s(#0())))), +^#(+(@x, @y), @r), +^#(@x, @y), diff#1^#(#less(-(-(@x, @y), @r), #0())), #less^#(-(-(@x, @y), @r), #0()), -^#(-(@x, @y), @r), -^#(@x, @y)) , mod^#(@x, @y) -> c_36(-^#(@x, *(@y, div(@x, @y))), *^#(@y, div(@x, @y)), div^#(@x, @y)) , diff#1^#(#false()) -> c_37(#abs^#(#0())) , diff#1^#(#true()) -> c_38(#abs^#(#pos(#s(#0())))) , div^#(@x, @y) -> c_39(#div^#(@x, @y)) , leq^#(@b1, @b2) -> c_40(#less^#(compare(@b1, @b2), #pos(#s(#0()))), compare^#(@b1, @b2)) , mult^#(@b1, @b2) -> c_41(mult#1^#(@b1, @b2)) , mult#1^#(::(@x, @xs), @b2) -> c_42(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x), #abs^#(#0()), mult^#(@xs, @b2)) , mult#1^#(nil(), @b2) -> c_43() , mult#2^#(@zs, @b2, @x) -> c_44(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs), #equal^#(@x, #pos(#s(#0())))) , mult#3^#(#false(), @b2, @zs) -> c_45() , mult#3^#(#true(), @b2, @zs) -> c_46(add^#(@b2, @zs)) , mult3^#(@b1, @b2, @b3) -> c_47(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2)) , sub^#(@b1, @b2) -> c_48(sub#1^#(sub'(@b1, @b2, #abs(#0()))), sub'^#(@b1, @b2, #abs(#0())), #abs^#(#0())) , sub#1^#(tuple#2(@b, @_@1)) -> c_50() , sub'^#(@b1, @b2, @r) -> c_49(sub'#1^#(@b1, @b2, @r)) , sub'#1^#(::(@x, @xs), @b2, @r) -> c_51(sub'#2^#(@b2, @r, @x, @xs)) , sub'#1^#(nil(), @b2, @r) -> c_52() , sub'#2^#(::(@y, @ys), @r, @x, @xs) -> c_53(sub'#3^#(diff(@x, @y, @r), @xs, @ys), diff^#(@x, @y, @r)) , sub'#2^#(nil(), @r, @x, @xs) -> c_54() , sub'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_55(sub'#4^#(sub'(@xs, @ys, @r'), @z), sub'^#(@xs, @ys, @r')) , sub'#4^#(tuple#2(@zs, @s), @z) -> c_56(sub'#5^#(#equal(@s, #pos(#s(#0()))), @z, @zs), #equal^#(@s, #pos(#s(#0())))) , sub'#5^#(#false(), @z, @zs) -> c_57() , sub'#5^#(#true(), @z, @zs) -> c_58(#abs^#(#0())) , sum#2^#(#false(), @s) -> c_60(sum#3^#(#equal(@s, #pos(#s(#0()))), @s), #equal^#(@s, #pos(#s(#0())))) , sum#2^#(#true(), @s) -> c_61(#abs^#(#0()), #abs^#(#0())) , sum#3^#(#false(), @s) -> c_62(sum#4^#(#equal(@s, #pos(#s(#s(#0()))))), #equal^#(@s, #pos(#s(#s(#0()))))) , sum#3^#(#true(), @s) -> c_63(#abs^#(#pos(#s(#0()))), #abs^#(#0())) , sum#4^#(#false()) -> c_64(#abs^#(#pos(#s(#0()))), #abs^#(#pos(#s(#0())))) , sum#4^#(#true()) -> c_65(#abs^#(#0()), #abs^#(#pos(#s(#0())))) } Weak DPs: { #eq^#(#0(), #0()) -> c_66() , #eq^#(#0(), #neg(@y)) -> c_67() , #eq^#(#0(), #pos(@y)) -> c_68() , #eq^#(#0(), #s(@y)) -> c_69() , #eq^#(#neg(@x), #0()) -> c_70() , #eq^#(#neg(@x), #neg(@y)) -> c_71(#eq^#(@x, @y)) , #eq^#(#neg(@x), #pos(@y)) -> c_72() , #eq^#(#pos(@x), #0()) -> c_73() , #eq^#(#pos(@x), #neg(@y)) -> c_74() , #eq^#(#pos(@x), #pos(@y)) -> c_75(#eq^#(@x, @y)) , #eq^#(#s(@x), #0()) -> c_76() , #eq^#(#s(@x), #s(@y)) -> c_77(#eq^#(@x, @y)) , #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) -> c_78(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)), #eq^#(@x_1, @y_1), #eq^#(@x_2, @y_2)) , #eq^#(::(@x_1, @x_2), nil()) -> c_79() , #eq^#(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> c_80() , #eq^#(nil(), ::(@y_1, @y_2)) -> c_81() , #eq^#(nil(), nil()) -> c_82() , #eq^#(nil(), tuple#2(@y_1, @y_2)) -> c_83() , #eq^#(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> c_84() , #eq^#(tuple#2(@x_1, @x_2), nil()) -> c_85() , #eq^#(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> c_86(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)), #eq^#(@x_1, @y_1), #eq^#(@x_2, @y_2)) , #ckgt^#(#EQ()) -> c_99() , #ckgt^#(#GT()) -> c_100() , #ckgt^#(#LT()) -> c_101() , #compare^#(#0(), #0()) -> c_87() , #compare^#(#0(), #neg(@y)) -> c_88() , #compare^#(#0(), #pos(@y)) -> c_89() , #compare^#(#0(), #s(@y)) -> c_90() , #compare^#(#neg(@x), #0()) -> c_91() , #compare^#(#neg(@x), #neg(@y)) -> c_92(#compare^#(@y, @x)) , #compare^#(#neg(@x), #pos(@y)) -> c_93() , #compare^#(#pos(@x), #0()) -> c_94() , #compare^#(#pos(@x), #neg(@y)) -> c_95() , #compare^#(#pos(@x), #pos(@y)) -> c_96(#compare^#(@x, @y)) , #compare^#(#s(@x), #0()) -> c_97() , #compare^#(#s(@x), #s(@y)) -> c_98(#compare^#(@x, @y)) , #cklt^#(#EQ()) -> c_102() , #cklt^#(#GT()) -> c_103() , #cklt^#(#LT()) -> c_104() , #mult^#(#0(), #0()) -> c_105() , #mult^#(#0(), #neg(@y)) -> c_106() , #mult^#(#0(), #pos(@y)) -> c_107() , #mult^#(#neg(@x), #0()) -> c_108() , #mult^#(#neg(@x), #neg(@y)) -> c_109(#natmult^#(@x, @y)) , #mult^#(#neg(@x), #pos(@y)) -> c_110(#natmult^#(@x, @y)) , #mult^#(#pos(@x), #0()) -> c_111() , #mult^#(#pos(@x), #neg(@y)) -> c_112(#natmult^#(@x, @y)) , #mult^#(#pos(@x), #pos(@y)) -> c_113(#natmult^#(@x, @y)) , #add^#(#0(), @y) -> c_114() , #add^#(#neg(#s(#0())), @y) -> c_115(#pred^#(@y)) , #add^#(#neg(#s(#s(@x))), @y) -> c_116(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) , #add^#(#pos(#s(#0())), @y) -> c_117(#succ^#(@y)) , #add^#(#pos(#s(#s(@x))), @y) -> c_118(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) , #sub^#(@x, #0()) -> c_119() , #sub^#(@x, #neg(@y)) -> c_120(#add^#(@x, #pos(@y))) , #sub^#(@x, #pos(@y)) -> c_121(#add^#(@x, #neg(@y))) , #div^#(#0(), #0()) -> c_122() , #div^#(#0(), #neg(@y)) -> c_123() , #div^#(#0(), #pos(@y)) -> c_124() , #div^#(#neg(@x), #0()) -> c_125() , #div^#(#neg(@x), #neg(@y)) -> c_126(#positive^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) , #div^#(#neg(@x), #pos(@y)) -> c_127(#negative^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) , #div^#(#pos(@x), #0()) -> c_128() , #div^#(#pos(@x), #neg(@y)) -> c_129(#negative^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) , #div^#(#pos(@x), #pos(@y)) -> c_130(#positive^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) , #and^#(#false(), #false()) -> c_139() , #and^#(#false(), #true()) -> c_140() , #and^#(#true(), #false()) -> c_141() , #and^#(#true(), #true()) -> c_142() , #natmult^#(#0(), @y) -> c_159() , #natmult^#(#s(@x), @y) -> c_160(#natadd^#(@y, #natmult(@x, @y)), #natmult^#(@x, @y)) , #pred^#(#0()) -> c_131() , #pred^#(#neg(#s(@x))) -> c_132() , #pred^#(#pos(#s(#0()))) -> c_133() , #pred^#(#pos(#s(#s(@x)))) -> c_134() , #succ^#(#0()) -> c_135() , #succ^#(#neg(#s(#0()))) -> c_136() , #succ^#(#neg(#s(#s(@x)))) -> c_137() , #succ^#(#pos(#s(@x))) -> c_138() , #positive^#(#0()) -> c_147() , #positive^#(#neg(@x)) -> c_148() , #positive^#(#pos(@x)) -> c_149() , #positive^#(#s(@x)) -> c_150() , #natdiv^#(#0(), #0()) -> c_143() , #natdiv^#(#0(), #s(@y)) -> c_144() , #natdiv^#(#s(@x), #0()) -> c_145() , #natdiv^#(#s(@x), #s(@y)) -> c_146(#natdiv'^#(#divsub(@x, @y), #s(@y)), #divsub^#(@x, @y)) , #negative^#(#0()) -> c_151() , #negative^#(#neg(@x)) -> c_152() , #negative^#(#pos(@x)) -> c_153() , #negative^#(#s(@x)) -> c_154() , #natdiv'^#(#0(), @y) -> c_163() , #natdiv'^#(#s(@x), @y) -> c_164(#natdiv^#(#s(@x), @y)) , #natdiv'^#(#underflow(), @y) -> c_165() , #divsub^#(#0(), #0()) -> c_155() , #divsub^#(#0(), #s(@y)) -> c_156() , #divsub^#(#s(@x), #0()) -> c_157() , #divsub^#(#s(@x), #s(@y)) -> c_158(#divsub^#(@x, @y)) , #natadd^#(#0(), @y) -> c_161() , #natadd^#(#s(@x), @y) -> c_162(#natadd^#(@x, @y)) , #natsub^#(@x, #0()) -> c_166() , #natsub^#(#s(@x), #s(@y)) -> c_167(#natsub^#(@x, @y)) } Weak Trs: { #abs(#0()) -> #0() , #abs(#neg(@x)) -> #pos(@x) , #abs(#pos(@x)) -> #pos(@x) , #abs(#s(@x)) -> #pos(#s(@x)) , #equal(@x, @y) -> #eq(@x, @y) , #eq(#0(), #0()) -> #true() , #eq(#0(), #neg(@y)) -> #false() , #eq(#0(), #pos(@y)) -> #false() , #eq(#0(), #s(@y)) -> #false() , #eq(#neg(@x), #0()) -> #false() , #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #pos(@y)) -> #false() , #eq(#pos(@x), #0()) -> #false() , #eq(#pos(@x), #neg(@y)) -> #false() , #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y) , #eq(#s(@x), #0()) -> #false() , #eq(#s(@x), #s(@y)) -> #eq(@x, @y) , #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #eq(::(@x_1, @x_2), nil()) -> #false() , #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false() , #eq(nil(), ::(@y_1, @y_2)) -> #false() , #eq(nil(), nil()) -> #true() , #eq(nil(), tuple#2(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), nil()) -> #false() , #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #greater(@x, @y) -> #ckgt(#compare(@x, @y)) , #compare(#0(), #0()) -> #EQ() , #compare(#0(), #neg(@y)) -> #GT() , #compare(#0(), #pos(@y)) -> #LT() , #compare(#0(), #s(@y)) -> #LT() , #compare(#neg(@x), #0()) -> #LT() , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x) , #compare(#neg(@x), #pos(@y)) -> #LT() , #compare(#pos(@x), #0()) -> #GT() , #compare(#pos(@x), #neg(@y)) -> #GT() , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y) , #compare(#s(@x), #0()) -> #GT() , #compare(#s(@x), #s(@y)) -> #compare(@x, @y) , #ckgt(#EQ()) -> #false() , #ckgt(#GT()) -> #true() , #ckgt(#LT()) -> #false() , #less(@x, @y) -> #cklt(#compare(@x, @y)) , #cklt(#EQ()) -> #false() , #cklt(#GT()) -> #false() , #cklt(#LT()) -> #true() , *(@x, @y) -> #mult(@x, @y) , #mult(#0(), #0()) -> #0() , #mult(#0(), #neg(@y)) -> #0() , #mult(#0(), #pos(@y)) -> #0() , #mult(#neg(@x), #0()) -> #0() , #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y)) , #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #0()) -> #0() , #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y)) , +(@x, @y) -> #add(@x, @y) , #add(#0(), @y) -> @y , #add(#neg(#s(#0())), @y) -> #pred(@y) , #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y)) , #add(#pos(#s(#0())), @y) -> #succ(@y) , #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y)) , -(@x, @y) -> #sub(@x, @y) , #sub(@x, #0()) -> @x , #sub(@x, #neg(@y)) -> #add(@x, #pos(@y)) , #sub(@x, #pos(@y)) -> #add(@x, #neg(@y)) , add(@b1, @b2) -> add'(@b1, @b2, #abs(#0())) , add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r) , add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs) , add'#1(nil(), @b2, @r) -> nil() , add'#2(::(@y, @ys), @r, @x, @xs) -> add'#3(sum(@x, @y, @r), @xs, @ys) , add'#2(nil(), @r, @x, @xs) -> nil() , sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r)) , add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r')) , bitToInt(@b) -> bitToInt'(@b, #abs(#pos(#s(#0())))) , bitToInt'(@b, @n) -> bitToInt'#1(@b, @n) , bitToInt'#1(::(@x, @xs), @n) -> +(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))) , bitToInt'#1(nil(), @n) -> #abs(#0()) , compare(@b1, @b2) -> compare#1(@b1, @b2) , compare#1(::(@x, @xs), @b2) -> compare#2(@b2, @x, @xs) , compare#1(nil(), @b2) -> #abs(#0()) , compare#2(::(@y, @ys), @x, @xs) -> compare#3(compare(@xs, @ys), @x, @y) , compare#2(nil(), @x, @xs) -> #abs(#0()) , compare#3(@r, @x, @y) -> compare#4(#equal(@r, #0()), @r, @x, @y) , compare#4(#false(), @r, @x, @y) -> @r , compare#4(#true(), @r, @x, @y) -> compare#5(#less(@x, @y), @x, @y) , compare#5(#false(), @x, @y) -> compare#6(#greater(@x, @y)) , compare#5(#true(), @x, @y) -> -(#0(), #pos(#s(#0()))) , compare#6(#false()) -> #abs(#0()) , compare#6(#true()) -> #abs(#pos(#s(#0()))) , diff(@x, @y, @r) -> tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))), diff#1(#less(-(-(@x, @y), @r), #0()))) , mod(@x, @y) -> -(@x, *(@y, div(@x, @y))) , diff#1(#false()) -> #abs(#0()) , diff#1(#true()) -> #abs(#pos(#s(#0()))) , div(@x, @y) -> #div(@x, @y) , #div(#0(), #0()) -> #divByZero() , #div(#0(), #neg(@y)) -> #0() , #div(#0(), #pos(@y)) -> #0() , #div(#neg(@x), #0()) -> #divByZero() , #div(#neg(@x), #neg(@y)) -> #positive(#natdiv(@x, @y)) , #div(#neg(@x), #pos(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #0()) -> #divByZero() , #div(#pos(@x), #neg(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #pos(@y)) -> #positive(#natdiv(@x, @y)) , leq(@b1, @b2) -> #less(compare(@b1, @b2), #pos(#s(#0()))) , mult(@b1, @b2) -> mult#1(@b1, @b2) , mult#1(::(@x, @xs), @b2) -> mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x) , mult#1(nil(), @b2) -> nil() , mult#2(@zs, @b2, @x) -> mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs) , mult#3(#false(), @b2, @zs) -> @zs , mult#3(#true(), @b2, @zs) -> add(@b2, @zs) , mult3(@b1, @b2, @b3) -> mult(mult(@b1, @b2), @b2) , sub(@b1, @b2) -> sub#1(sub'(@b1, @b2, #abs(#0()))) , sub'(@b1, @b2, @r) -> sub'#1(@b1, @b2, @r) , sub#1(tuple#2(@b, @_@1)) -> @b , sub'#1(::(@x, @xs), @b2, @r) -> sub'#2(@b2, @r, @x, @xs) , sub'#1(nil(), @b2, @r) -> tuple#2(nil(), @r) , sub'#2(::(@y, @ys), @r, @x, @xs) -> sub'#3(diff(@x, @y, @r), @xs, @ys) , sub'#2(nil(), @r, @x, @xs) -> tuple#2(nil(), @r) , sub'#3(tuple#2(@z, @r'), @xs, @ys) -> sub'#4(sub'(@xs, @ys, @r'), @z) , sub'#4(tuple#2(@zs, @s), @z) -> tuple#2(sub'#5(#equal(@s, #pos(#s(#0()))), @z, @zs), @s) , sub'#5(#false(), @z, @zs) -> ::(@z, @zs) , sub'#5(#true(), @z, @zs) -> ::(#abs(#0()), @zs) , sum#1(@s) -> sum#2(#equal(@s, #0()), @s) , sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s) , sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0())) , sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0()))))) , sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0())) , sum#4(#false()) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0())))) , sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0())))) , #pred(#0()) -> #neg(#s(#0())) , #pred(#neg(#s(@x))) -> #neg(#s(#s(@x))) , #pred(#pos(#s(#0()))) -> #0() , #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x)) , #succ(#0()) -> #pos(#s(#0())) , #succ(#neg(#s(#0()))) -> #0() , #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x)) , #succ(#pos(#s(@x))) -> #pos(#s(#s(@x))) , #and(#false(), #false()) -> #false() , #and(#false(), #true()) -> #false() , #and(#true(), #false()) -> #false() , #and(#true(), #true()) -> #true() , #natdiv(#0(), #0()) -> #divByZero() , #natdiv(#0(), #s(@y)) -> #0() , #natdiv(#s(@x), #0()) -> #divByZero() , #natdiv(#s(@x), #s(@y)) -> #natdiv'(#divsub(@x, @y), #s(@y)) , #positive(#0()) -> #0() , #positive(#neg(@x)) -> #neg(@x) , #positive(#pos(@x)) -> #pos(@x) , #positive(#s(@x)) -> #pos(#s(@x)) , #negative(#0()) -> #0() , #negative(#neg(@x)) -> #pos(@x) , #negative(#pos(@x)) -> #neg(@x) , #negative(#s(@x)) -> #neg(#s(@x)) , #divsub(#0(), #0()) -> #0() , #divsub(#0(), #s(@y)) -> #underflow() , #divsub(#s(@x), #0()) -> #s(@x) , #divsub(#s(@x), #s(@y)) -> #divsub(@x, @y) , #natmult(#0(), @y) -> #0() , #natmult(#s(@x), @y) -> #natadd(@y, #natmult(@x, @y)) , #natadd(#0(), @y) -> @y , #natadd(#s(@x), @y) -> #s(#natadd(@x, @y)) , #natdiv'(#0(), @y) -> #s(#0()) , #natdiv'(#s(@x), @y) -> #s(#natdiv(#s(@x), @y)) , #natdiv'(#underflow(), @y) -> #0() , #natsub(@x, #0()) -> @x , #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^2)) Consider the dependency graph 1: #abs^#(#0()) -> c_1() 2: #abs^#(#neg(@x)) -> c_2() 3: #abs^#(#pos(@x)) -> c_3() 4: #abs^#(#s(@x)) -> c_4() 5: #equal^#(@x, @y) -> c_5(#eq^#(@x, @y)) -->_1 #eq^#(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> c_86(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)), #eq^#(@x_1, @y_1), #eq^#(@x_2, @y_2)) :86 -->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) -> c_78(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)), #eq^#(@x_1, @y_1), #eq^#(@x_2, @y_2)) :78 -->_1 #eq^#(#s(@x), #s(@y)) -> c_77(#eq^#(@x, @y)) :77 -->_1 #eq^#(#pos(@x), #pos(@y)) -> c_75(#eq^#(@x, @y)) :75 -->_1 #eq^#(#neg(@x), #neg(@y)) -> c_71(#eq^#(@x, @y)) :71 -->_1 #eq^#(tuple#2(@x_1, @x_2), nil()) -> c_85() :85 -->_1 #eq^#(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> c_84() :84 -->_1 #eq^#(nil(), tuple#2(@y_1, @y_2)) -> c_83() :83 -->_1 #eq^#(nil(), nil()) -> c_82() :82 -->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_81() :81 -->_1 #eq^#(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> c_80() :80 -->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_79() :79 -->_1 #eq^#(#s(@x), #0()) -> c_76() :76 -->_1 #eq^#(#pos(@x), #neg(@y)) -> c_74() :74 -->_1 #eq^#(#pos(@x), #0()) -> c_73() :73 -->_1 #eq^#(#neg(@x), #pos(@y)) -> c_72() :72 -->_1 #eq^#(#neg(@x), #0()) -> c_70() :70 -->_1 #eq^#(#0(), #s(@y)) -> c_69() :69 -->_1 #eq^#(#0(), #pos(@y)) -> c_68() :68 -->_1 #eq^#(#0(), #neg(@y)) -> c_67() :67 -->_1 #eq^#(#0(), #0()) -> c_66() :66 6: #greater^#(@x, @y) -> c_6(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y)) -->_2 #compare^#(#s(@x), #s(@y)) -> c_98(#compare^#(@x, @y)) :101 -->_2 #compare^#(#pos(@x), #pos(@y)) -> c_96(#compare^#(@x, @y)) :99 -->_2 #compare^#(#neg(@x), #neg(@y)) -> c_92(#compare^#(@y, @x)) :95 -->_2 #compare^#(#s(@x), #0()) -> c_97() :100 -->_2 #compare^#(#pos(@x), #neg(@y)) -> c_95() :98 -->_2 #compare^#(#pos(@x), #0()) -> c_94() :97 -->_2 #compare^#(#neg(@x), #pos(@y)) -> c_93() :96 -->_2 #compare^#(#neg(@x), #0()) -> c_91() :94 -->_2 #compare^#(#0(), #s(@y)) -> c_90() :93 -->_2 #compare^#(#0(), #pos(@y)) -> c_89() :92 -->_2 #compare^#(#0(), #neg(@y)) -> c_88() :91 -->_2 #compare^#(#0(), #0()) -> c_87() :90 -->_1 #ckgt^#(#LT()) -> c_101() :89 -->_1 #ckgt^#(#GT()) -> c_100() :88 -->_1 #ckgt^#(#EQ()) -> c_99() :87 7: #less^#(@x, @y) -> c_7(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y)) -->_2 #compare^#(#s(@x), #s(@y)) -> c_98(#compare^#(@x, @y)) :101 -->_2 #compare^#(#pos(@x), #pos(@y)) -> c_96(#compare^#(@x, @y)) :99 -->_2 #compare^#(#neg(@x), #neg(@y)) -> c_92(#compare^#(@y, @x)) :95 -->_1 #cklt^#(#LT()) -> c_104() :104 -->_1 #cklt^#(#GT()) -> c_103() :103 -->_1 #cklt^#(#EQ()) -> c_102() :102 -->_2 #compare^#(#s(@x), #0()) -> c_97() :100 -->_2 #compare^#(#pos(@x), #neg(@y)) -> c_95() :98 -->_2 #compare^#(#pos(@x), #0()) -> c_94() :97 -->_2 #compare^#(#neg(@x), #pos(@y)) -> c_93() :96 -->_2 #compare^#(#neg(@x), #0()) -> c_91() :94 -->_2 #compare^#(#0(), #s(@y)) -> c_90() :93 -->_2 #compare^#(#0(), #pos(@y)) -> c_89() :92 -->_2 #compare^#(#0(), #neg(@y)) -> c_88() :91 -->_2 #compare^#(#0(), #0()) -> c_87() :90 8: *^#(@x, @y) -> c_8(#mult^#(@x, @y)) -->_1 #mult^#(#pos(@x), #pos(@y)) -> c_113(#natmult^#(@x, @y)) :113 -->_1 #mult^#(#pos(@x), #neg(@y)) -> c_112(#natmult^#(@x, @y)) :112 -->_1 #mult^#(#neg(@x), #pos(@y)) -> c_110(#natmult^#(@x, @y)) :110 -->_1 #mult^#(#neg(@x), #neg(@y)) -> c_109(#natmult^#(@x, @y)) :109 -->_1 #mult^#(#pos(@x), #0()) -> c_111() :111 -->_1 #mult^#(#neg(@x), #0()) -> c_108() :108 -->_1 #mult^#(#0(), #pos(@y)) -> c_107() :107 -->_1 #mult^#(#0(), #neg(@y)) -> c_106() :106 -->_1 #mult^#(#0(), #0()) -> c_105() :105 9: +^#(@x, @y) -> c_9(#add^#(@x, @y)) -->_1 #add^#(#pos(#s(#s(@x))), @y) -> c_118(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :118 -->_1 #add^#(#pos(#s(#0())), @y) -> c_117(#succ^#(@y)) :117 -->_1 #add^#(#neg(#s(#s(@x))), @y) -> c_116(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :116 -->_1 #add^#(#neg(#s(#0())), @y) -> c_115(#pred^#(@y)) :115 -->_1 #add^#(#0(), @y) -> c_114() :114 10: -^#(@x, @y) -> c_10(#sub^#(@x, @y)) -->_1 #sub^#(@x, #pos(@y)) -> c_121(#add^#(@x, #neg(@y))) :121 -->_1 #sub^#(@x, #neg(@y)) -> c_120(#add^#(@x, #pos(@y))) :120 -->_1 #sub^#(@x, #0()) -> c_119() :119 11: add^#(@b1, @b2) -> c_11(add'^#(@b1, @b2, #abs(#0())), #abs^#(#0())) -->_1 add'^#(@b1, @b2, @r) -> c_12(add'#1^#(@b1, @b2, @r)) :12 -->_2 #abs^#(#0()) -> c_1() :1 12: add'^#(@b1, @b2, @r) -> c_12(add'#1^#(@b1, @b2, @r)) -->_1 add'#1^#(::(@x, @xs), @b2, @r) -> c_13(add'#2^#(@b2, @r, @x, @xs)) :13 -->_1 add'#1^#(nil(), @b2, @r) -> c_14() :14 13: add'#1^#(::(@x, @xs), @b2, @r) -> c_13(add'#2^#(@b2, @r, @x, @xs)) -->_1 add'#2^#(::(@y, @ys), @r, @x, @xs) -> c_15(add'#3^#(sum(@x, @y, @r), @xs, @ys), sum^#(@x, @y, @r)) :15 -->_1 add'#2^#(nil(), @r, @x, @xs) -> c_16() :16 14: add'#1^#(nil(), @b2, @r) -> c_14() 15: add'#2^#(::(@y, @ys), @r, @x, @xs) -> c_15(add'#3^#(sum(@x, @y, @r), @xs, @ys), sum^#(@x, @y, @r)) -->_2 sum^#(@x, @y, @r) -> c_17(sum#1^#(+(+(@x, @y), @r)), +^#(+(@x, @y), @r), +^#(@x, @y)) :18 -->_1 add'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_18(add'^#(@xs, @ys, @r')) :17 16: add'#2^#(nil(), @r, @x, @xs) -> c_16() 17: add'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_18(add'^#(@xs, @ys, @r')) -->_1 add'^#(@b1, @b2, @r) -> c_12(add'#1^#(@b1, @b2, @r)) :12 18: sum^#(@x, @y, @r) -> c_17(sum#1^#(+(+(@x, @y), @r)), +^#(+(@x, @y), @r), +^#(@x, @y)) -->_1 sum#1^#(@s) -> c_59(sum#2^#(#equal(@s, #0()), @s), #equal^#(@s, #0())) :19 -->_3 +^#(@x, @y) -> c_9(#add^#(@x, @y)) :9 -->_2 +^#(@x, @y) -> c_9(#add^#(@x, @y)) :9 19: sum#1^#(@s) -> c_59(sum#2^#(#equal(@s, #0()), @s), #equal^#(@s, #0())) -->_1 sum#2^#(#true(), @s) -> c_61(#abs^#(#0()), #abs^#(#0())) :61 -->_1 sum#2^#(#false(), @s) -> c_60(sum#3^#(#equal(@s, #pos(#s(#0()))), @s), #equal^#(@s, #pos(#s(#0())))) :60 -->_2 #equal^#(@x, @y) -> c_5(#eq^#(@x, @y)) :5 20: bitToInt^#(@b) -> c_19(bitToInt'^#(@b, #abs(#pos(#s(#0())))), #abs^#(#pos(#s(#0())))) -->_1 bitToInt'^#(@b, @n) -> c_20(bitToInt'#1^#(@b, @n)) :21 -->_2 #abs^#(#pos(@x)) -> c_3() :3 21: bitToInt'^#(@b, @n) -> c_20(bitToInt'#1^#(@b, @n)) -->_1 bitToInt'#1^#(nil(), @n) -> c_22(#abs^#(#0())) :23 -->_1 bitToInt'#1^#(::(@x, @xs), @n) -> c_21(+^#(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))), *^#(@x, @n), bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))), *^#(@n, #pos(#s(#s(#0()))))) :22 22: bitToInt'#1^#(::(@x, @xs), @n) -> c_21(+^#(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))), *^#(@x, @n), bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))), *^#(@n, #pos(#s(#s(#0()))))) -->_3 bitToInt'^#(@b, @n) -> c_20(bitToInt'#1^#(@b, @n)) :21 -->_1 +^#(@x, @y) -> c_9(#add^#(@x, @y)) :9 -->_4 *^#(@x, @y) -> c_8(#mult^#(@x, @y)) :8 -->_2 *^#(@x, @y) -> c_8(#mult^#(@x, @y)) :8 23: bitToInt'#1^#(nil(), @n) -> c_22(#abs^#(#0())) -->_1 #abs^#(#0()) -> c_1() :1 24: compare^#(@b1, @b2) -> c_23(compare#1^#(@b1, @b2)) -->_1 compare#1^#(nil(), @b2) -> c_25(#abs^#(#0())) :26 -->_1 compare#1^#(::(@x, @xs), @b2) -> c_24(compare#2^#(@b2, @x, @xs)) :25 25: compare#1^#(::(@x, @xs), @b2) -> c_24(compare#2^#(@b2, @x, @xs)) -->_1 compare#2^#(nil(), @x, @xs) -> c_27(#abs^#(#0())) :28 -->_1 compare#2^#(::(@y, @ys), @x, @xs) -> c_26(compare#3^#(compare(@xs, @ys), @x, @y), compare^#(@xs, @ys)) :27 26: compare#1^#(nil(), @b2) -> c_25(#abs^#(#0())) -->_1 #abs^#(#0()) -> c_1() :1 27: compare#2^#(::(@y, @ys), @x, @xs) -> c_26(compare#3^#(compare(@xs, @ys), @x, @y), compare^#(@xs, @ys)) -->_1 compare#3^#(@r, @x, @y) -> c_28(compare#4^#(#equal(@r, #0()), @r, @x, @y), #equal^#(@r, #0())) :29 -->_2 compare^#(@b1, @b2) -> c_23(compare#1^#(@b1, @b2)) :24 28: compare#2^#(nil(), @x, @xs) -> c_27(#abs^#(#0())) -->_1 #abs^#(#0()) -> c_1() :1 29: compare#3^#(@r, @x, @y) -> c_28(compare#4^#(#equal(@r, #0()), @r, @x, @y), #equal^#(@r, #0())) -->_1 compare#4^#(#true(), @r, @x, @y) -> c_30(compare#5^#(#less(@x, @y), @x, @y), #less^#(@x, @y)) :31 -->_1 compare#4^#(#false(), @r, @x, @y) -> c_29() :30 -->_2 #equal^#(@x, @y) -> c_5(#eq^#(@x, @y)) :5 30: compare#4^#(#false(), @r, @x, @y) -> c_29() 31: compare#4^#(#true(), @r, @x, @y) -> c_30(compare#5^#(#less(@x, @y), @x, @y), #less^#(@x, @y)) -->_1 compare#5^#(#true(), @x, @y) -> c_32(-^#(#0(), #pos(#s(#0())))) :33 -->_1 compare#5^#(#false(), @x, @y) -> c_31(compare#6^#(#greater(@x, @y)), #greater^#(@x, @y)) :32 -->_2 #less^#(@x, @y) -> c_7(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y)) :7 32: compare#5^#(#false(), @x, @y) -> c_31(compare#6^#(#greater(@x, @y)), #greater^#(@x, @y)) -->_1 compare#6^#(#true()) -> c_34(#abs^#(#pos(#s(#0())))) :35 -->_1 compare#6^#(#false()) -> c_33(#abs^#(#0())) :34 -->_2 #greater^#(@x, @y) -> c_6(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y)) :6 33: compare#5^#(#true(), @x, @y) -> c_32(-^#(#0(), #pos(#s(#0())))) -->_1 -^#(@x, @y) -> c_10(#sub^#(@x, @y)) :10 34: compare#6^#(#false()) -> c_33(#abs^#(#0())) -->_1 #abs^#(#0()) -> c_1() :1 35: compare#6^#(#true()) -> c_34(#abs^#(#pos(#s(#0())))) -->_1 #abs^#(#pos(@x)) -> c_3() :3 36: diff^#(@x, @y, @r) -> c_35(mod^#(+(+(@x, @y), @r), #pos(#s(#s(#0())))), +^#(+(@x, @y), @r), +^#(@x, @y), diff#1^#(#less(-(-(@x, @y), @r), #0())), #less^#(-(-(@x, @y), @r), #0()), -^#(-(@x, @y), @r), -^#(@x, @y)) -->_4 diff#1^#(#true()) -> c_38(#abs^#(#pos(#s(#0())))) :39 -->_4 diff#1^#(#false()) -> c_37(#abs^#(#0())) :38 -->_1 mod^#(@x, @y) -> c_36(-^#(@x, *(@y, div(@x, @y))), *^#(@y, div(@x, @y)), div^#(@x, @y)) :37 -->_7 -^#(@x, @y) -> c_10(#sub^#(@x, @y)) :10 -->_6 -^#(@x, @y) -> c_10(#sub^#(@x, @y)) :10 -->_3 +^#(@x, @y) -> c_9(#add^#(@x, @y)) :9 -->_2 +^#(@x, @y) -> c_9(#add^#(@x, @y)) :9 -->_5 #less^#(@x, @y) -> c_7(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y)) :7 37: mod^#(@x, @y) -> c_36(-^#(@x, *(@y, div(@x, @y))), *^#(@y, div(@x, @y)), div^#(@x, @y)) -->_3 div^#(@x, @y) -> c_39(#div^#(@x, @y)) :40 -->_1 -^#(@x, @y) -> c_10(#sub^#(@x, @y)) :10 -->_2 *^#(@x, @y) -> c_8(#mult^#(@x, @y)) :8 38: diff#1^#(#false()) -> c_37(#abs^#(#0())) -->_1 #abs^#(#0()) -> c_1() :1 39: diff#1^#(#true()) -> c_38(#abs^#(#pos(#s(#0())))) -->_1 #abs^#(#pos(@x)) -> c_3() :3 40: div^#(@x, @y) -> c_39(#div^#(@x, @y)) -->_1 #div^#(#pos(@x), #pos(@y)) -> c_130(#positive^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) :130 -->_1 #div^#(#pos(@x), #neg(@y)) -> c_129(#negative^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) :129 -->_1 #div^#(#neg(@x), #pos(@y)) -> c_127(#negative^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) :127 -->_1 #div^#(#neg(@x), #neg(@y)) -> c_126(#positive^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) :126 -->_1 #div^#(#pos(@x), #0()) -> c_128() :128 -->_1 #div^#(#neg(@x), #0()) -> c_125() :125 -->_1 #div^#(#0(), #pos(@y)) -> c_124() :124 -->_1 #div^#(#0(), #neg(@y)) -> c_123() :123 -->_1 #div^#(#0(), #0()) -> c_122() :122 41: leq^#(@b1, @b2) -> c_40(#less^#(compare(@b1, @b2), #pos(#s(#0()))), compare^#(@b1, @b2)) -->_2 compare^#(@b1, @b2) -> c_23(compare#1^#(@b1, @b2)) :24 -->_1 #less^#(@x, @y) -> c_7(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y)) :7 42: mult^#(@b1, @b2) -> c_41(mult#1^#(@b1, @b2)) -->_1 mult#1^#(::(@x, @xs), @b2) -> c_42(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x), #abs^#(#0()), mult^#(@xs, @b2)) :43 -->_1 mult#1^#(nil(), @b2) -> c_43() :44 43: mult#1^#(::(@x, @xs), @b2) -> c_42(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x), #abs^#(#0()), mult^#(@xs, @b2)) -->_1 mult#2^#(@zs, @b2, @x) -> c_44(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs), #equal^#(@x, #pos(#s(#0())))) :45 -->_3 mult^#(@b1, @b2) -> c_41(mult#1^#(@b1, @b2)) :42 -->_2 #abs^#(#0()) -> c_1() :1 44: mult#1^#(nil(), @b2) -> c_43() 45: mult#2^#(@zs, @b2, @x) -> c_44(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs), #equal^#(@x, #pos(#s(#0())))) -->_1 mult#3^#(#true(), @b2, @zs) -> c_46(add^#(@b2, @zs)) :47 -->_1 mult#3^#(#false(), @b2, @zs) -> c_45() :46 -->_2 #equal^#(@x, @y) -> c_5(#eq^#(@x, @y)) :5 46: mult#3^#(#false(), @b2, @zs) -> c_45() 47: mult#3^#(#true(), @b2, @zs) -> c_46(add^#(@b2, @zs)) -->_1 add^#(@b1, @b2) -> c_11(add'^#(@b1, @b2, #abs(#0())), #abs^#(#0())) :11 48: mult3^#(@b1, @b2, @b3) -> c_47(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2)) -->_2 mult^#(@b1, @b2) -> c_41(mult#1^#(@b1, @b2)) :42 -->_1 mult^#(@b1, @b2) -> c_41(mult#1^#(@b1, @b2)) :42 49: sub^#(@b1, @b2) -> c_48(sub#1^#(sub'(@b1, @b2, #abs(#0()))), sub'^#(@b1, @b2, #abs(#0())), #abs^#(#0())) -->_2 sub'^#(@b1, @b2, @r) -> c_49(sub'#1^#(@b1, @b2, @r)) :51 -->_1 sub#1^#(tuple#2(@b, @_@1)) -> c_50() :50 -->_3 #abs^#(#0()) -> c_1() :1 50: sub#1^#(tuple#2(@b, @_@1)) -> c_50() 51: sub'^#(@b1, @b2, @r) -> c_49(sub'#1^#(@b1, @b2, @r)) -->_1 sub'#1^#(::(@x, @xs), @b2, @r) -> c_51(sub'#2^#(@b2, @r, @x, @xs)) :52 -->_1 sub'#1^#(nil(), @b2, @r) -> c_52() :53 52: sub'#1^#(::(@x, @xs), @b2, @r) -> c_51(sub'#2^#(@b2, @r, @x, @xs)) -->_1 sub'#2^#(::(@y, @ys), @r, @x, @xs) -> c_53(sub'#3^#(diff(@x, @y, @r), @xs, @ys), diff^#(@x, @y, @r)) :54 -->_1 sub'#2^#(nil(), @r, @x, @xs) -> c_54() :55 53: sub'#1^#(nil(), @b2, @r) -> c_52() 54: sub'#2^#(::(@y, @ys), @r, @x, @xs) -> c_53(sub'#3^#(diff(@x, @y, @r), @xs, @ys), diff^#(@x, @y, @r)) -->_1 sub'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_55(sub'#4^#(sub'(@xs, @ys, @r'), @z), sub'^#(@xs, @ys, @r')) :56 -->_2 diff^#(@x, @y, @r) -> c_35(mod^#(+(+(@x, @y), @r), #pos(#s(#s(#0())))), +^#(+(@x, @y), @r), +^#(@x, @y), diff#1^#(#less(-(-(@x, @y), @r), #0())), #less^#(-(-(@x, @y), @r), #0()), -^#(-(@x, @y), @r), -^#(@x, @y)) :36 55: sub'#2^#(nil(), @r, @x, @xs) -> c_54() 56: sub'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_55(sub'#4^#(sub'(@xs, @ys, @r'), @z), sub'^#(@xs, @ys, @r')) -->_1 sub'#4^#(tuple#2(@zs, @s), @z) -> c_56(sub'#5^#(#equal(@s, #pos(#s(#0()))), @z, @zs), #equal^#(@s, #pos(#s(#0())))) :57 -->_2 sub'^#(@b1, @b2, @r) -> c_49(sub'#1^#(@b1, @b2, @r)) :51 57: sub'#4^#(tuple#2(@zs, @s), @z) -> c_56(sub'#5^#(#equal(@s, #pos(#s(#0()))), @z, @zs), #equal^#(@s, #pos(#s(#0())))) -->_1 sub'#5^#(#true(), @z, @zs) -> c_58(#abs^#(#0())) :59 -->_1 sub'#5^#(#false(), @z, @zs) -> c_57() :58 -->_2 #equal^#(@x, @y) -> c_5(#eq^#(@x, @y)) :5 58: sub'#5^#(#false(), @z, @zs) -> c_57() 59: sub'#5^#(#true(), @z, @zs) -> c_58(#abs^#(#0())) -->_1 #abs^#(#0()) -> c_1() :1 60: sum#2^#(#false(), @s) -> c_60(sum#3^#(#equal(@s, #pos(#s(#0()))), @s), #equal^#(@s, #pos(#s(#0())))) -->_1 sum#3^#(#true(), @s) -> c_63(#abs^#(#pos(#s(#0()))), #abs^#(#0())) :63 -->_1 sum#3^#(#false(), @s) -> c_62(sum#4^#(#equal(@s, #pos(#s(#s(#0()))))), #equal^#(@s, #pos(#s(#s(#0()))))) :62 -->_2 #equal^#(@x, @y) -> c_5(#eq^#(@x, @y)) :5 61: sum#2^#(#true(), @s) -> c_61(#abs^#(#0()), #abs^#(#0())) -->_2 #abs^#(#0()) -> c_1() :1 -->_1 #abs^#(#0()) -> c_1() :1 62: sum#3^#(#false(), @s) -> c_62(sum#4^#(#equal(@s, #pos(#s(#s(#0()))))), #equal^#(@s, #pos(#s(#s(#0()))))) -->_1 sum#4^#(#true()) -> c_65(#abs^#(#0()), #abs^#(#pos(#s(#0())))) :65 -->_1 sum#4^#(#false()) -> c_64(#abs^#(#pos(#s(#0()))), #abs^#(#pos(#s(#0())))) :64 -->_2 #equal^#(@x, @y) -> c_5(#eq^#(@x, @y)) :5 63: sum#3^#(#true(), @s) -> c_63(#abs^#(#pos(#s(#0()))), #abs^#(#0())) -->_1 #abs^#(#pos(@x)) -> c_3() :3 -->_2 #abs^#(#0()) -> c_1() :1 64: sum#4^#(#false()) -> c_64(#abs^#(#pos(#s(#0()))), #abs^#(#pos(#s(#0())))) -->_2 #abs^#(#pos(@x)) -> c_3() :3 -->_1 #abs^#(#pos(@x)) -> c_3() :3 65: sum#4^#(#true()) -> c_65(#abs^#(#0()), #abs^#(#pos(#s(#0())))) -->_2 #abs^#(#pos(@x)) -> c_3() :3 -->_1 #abs^#(#0()) -> c_1() :1 66: #eq^#(#0(), #0()) -> c_66() 67: #eq^#(#0(), #neg(@y)) -> c_67() 68: #eq^#(#0(), #pos(@y)) -> c_68() 69: #eq^#(#0(), #s(@y)) -> c_69() 70: #eq^#(#neg(@x), #0()) -> c_70() 71: #eq^#(#neg(@x), #neg(@y)) -> c_71(#eq^#(@x, @y)) -->_1 #eq^#(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> c_86(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)), #eq^#(@x_1, @y_1), #eq^#(@x_2, @y_2)) :86 -->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) -> c_78(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)), #eq^#(@x_1, @y_1), #eq^#(@x_2, @y_2)) :78 -->_1 #eq^#(#s(@x), #s(@y)) -> c_77(#eq^#(@x, @y)) :77 -->_1 #eq^#(#pos(@x), #pos(@y)) -> c_75(#eq^#(@x, @y)) :75 -->_1 #eq^#(tuple#2(@x_1, @x_2), nil()) -> c_85() :85 -->_1 #eq^#(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> c_84() :84 -->_1 #eq^#(nil(), tuple#2(@y_1, @y_2)) -> c_83() :83 -->_1 #eq^#(nil(), nil()) -> c_82() :82 -->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_81() :81 -->_1 #eq^#(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> c_80() :80 -->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_79() :79 -->_1 #eq^#(#s(@x), #0()) -> c_76() :76 -->_1 #eq^#(#pos(@x), #neg(@y)) -> c_74() :74 -->_1 #eq^#(#pos(@x), #0()) -> c_73() :73 -->_1 #eq^#(#neg(@x), #pos(@y)) -> c_72() :72 -->_1 #eq^#(#neg(@x), #neg(@y)) -> c_71(#eq^#(@x, @y)) :71 -->_1 #eq^#(#neg(@x), #0()) -> c_70() :70 -->_1 #eq^#(#0(), #s(@y)) -> c_69() :69 -->_1 #eq^#(#0(), #pos(@y)) -> c_68() :68 -->_1 #eq^#(#0(), #neg(@y)) -> c_67() :67 -->_1 #eq^#(#0(), #0()) -> c_66() :66 72: #eq^#(#neg(@x), #pos(@y)) -> c_72() 73: #eq^#(#pos(@x), #0()) -> c_73() 74: #eq^#(#pos(@x), #neg(@y)) -> c_74() 75: #eq^#(#pos(@x), #pos(@y)) -> c_75(#eq^#(@x, @y)) -->_1 #eq^#(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> c_86(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)), #eq^#(@x_1, @y_1), #eq^#(@x_2, @y_2)) :86 -->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) -> c_78(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)), #eq^#(@x_1, @y_1), #eq^#(@x_2, @y_2)) :78 -->_1 #eq^#(#s(@x), #s(@y)) -> c_77(#eq^#(@x, @y)) :77 -->_1 #eq^#(tuple#2(@x_1, @x_2), nil()) -> c_85() :85 -->_1 #eq^#(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> c_84() :84 -->_1 #eq^#(nil(), tuple#2(@y_1, @y_2)) -> c_83() :83 -->_1 #eq^#(nil(), nil()) -> c_82() :82 -->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_81() :81 -->_1 #eq^#(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> c_80() :80 -->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_79() :79 -->_1 #eq^#(#s(@x), #0()) -> c_76() :76 -->_1 #eq^#(#pos(@x), #pos(@y)) -> c_75(#eq^#(@x, @y)) :75 -->_1 #eq^#(#pos(@x), #neg(@y)) -> c_74() :74 -->_1 #eq^#(#pos(@x), #0()) -> c_73() :73 -->_1 #eq^#(#neg(@x), #pos(@y)) -> c_72() :72 -->_1 #eq^#(#neg(@x), #neg(@y)) -> c_71(#eq^#(@x, @y)) :71 -->_1 #eq^#(#neg(@x), #0()) -> c_70() :70 -->_1 #eq^#(#0(), #s(@y)) -> c_69() :69 -->_1 #eq^#(#0(), #pos(@y)) -> c_68() :68 -->_1 #eq^#(#0(), #neg(@y)) -> c_67() :67 -->_1 #eq^#(#0(), #0()) -> c_66() :66 76: #eq^#(#s(@x), #0()) -> c_76() 77: #eq^#(#s(@x), #s(@y)) -> c_77(#eq^#(@x, @y)) -->_1 #eq^#(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> c_86(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)), #eq^#(@x_1, @y_1), #eq^#(@x_2, @y_2)) :86 -->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) -> c_78(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)), #eq^#(@x_1, @y_1), #eq^#(@x_2, @y_2)) :78 -->_1 #eq^#(tuple#2(@x_1, @x_2), nil()) -> c_85() :85 -->_1 #eq^#(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> c_84() :84 -->_1 #eq^#(nil(), tuple#2(@y_1, @y_2)) -> c_83() :83 -->_1 #eq^#(nil(), nil()) -> c_82() :82 -->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_81() :81 -->_1 #eq^#(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> c_80() :80 -->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_79() :79 -->_1 #eq^#(#s(@x), #s(@y)) -> c_77(#eq^#(@x, @y)) :77 -->_1 #eq^#(#s(@x), #0()) -> c_76() :76 -->_1 #eq^#(#pos(@x), #pos(@y)) -> c_75(#eq^#(@x, @y)) :75 -->_1 #eq^#(#pos(@x), #neg(@y)) -> c_74() :74 -->_1 #eq^#(#pos(@x), #0()) -> c_73() :73 -->_1 #eq^#(#neg(@x), #pos(@y)) -> c_72() :72 -->_1 #eq^#(#neg(@x), #neg(@y)) -> c_71(#eq^#(@x, @y)) :71 -->_1 #eq^#(#neg(@x), #0()) -> c_70() :70 -->_1 #eq^#(#0(), #s(@y)) -> c_69() :69 -->_1 #eq^#(#0(), #pos(@y)) -> c_68() :68 -->_1 #eq^#(#0(), #neg(@y)) -> c_67() :67 -->_1 #eq^#(#0(), #0()) -> c_66() :66 78: #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) -> c_78(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)), #eq^#(@x_1, @y_1), #eq^#(@x_2, @y_2)) -->_3 #eq^#(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> c_86(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)), #eq^#(@x_1, @y_1), #eq^#(@x_2, @y_2)) :86 -->_2 #eq^#(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> c_86(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)), #eq^#(@x_1, @y_1), #eq^#(@x_2, @y_2)) :86 -->_1 #and^#(#true(), #true()) -> c_142() :134 -->_1 #and^#(#true(), #false()) -> c_141() :133 -->_1 #and^#(#false(), #true()) -> c_140() :132 -->_1 #and^#(#false(), #false()) -> c_139() :131 -->_3 #eq^#(tuple#2(@x_1, @x_2), nil()) -> c_85() :85 -->_2 #eq^#(tuple#2(@x_1, @x_2), nil()) -> c_85() :85 -->_3 #eq^#(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> c_84() :84 -->_2 #eq^#(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> c_84() :84 -->_3 #eq^#(nil(), tuple#2(@y_1, @y_2)) -> c_83() :83 -->_2 #eq^#(nil(), tuple#2(@y_1, @y_2)) -> c_83() :83 -->_3 #eq^#(nil(), nil()) -> c_82() :82 -->_2 #eq^#(nil(), nil()) -> c_82() :82 -->_3 #eq^#(nil(), ::(@y_1, @y_2)) -> c_81() :81 -->_2 #eq^#(nil(), ::(@y_1, @y_2)) -> c_81() :81 -->_3 #eq^#(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> c_80() :80 -->_2 #eq^#(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> c_80() :80 -->_3 #eq^#(::(@x_1, @x_2), nil()) -> c_79() :79 -->_2 #eq^#(::(@x_1, @x_2), nil()) -> c_79() :79 -->_3 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) -> c_78(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)), #eq^#(@x_1, @y_1), #eq^#(@x_2, @y_2)) :78 -->_2 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) -> c_78(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)), #eq^#(@x_1, @y_1), #eq^#(@x_2, @y_2)) :78 -->_3 #eq^#(#s(@x), #s(@y)) -> c_77(#eq^#(@x, @y)) :77 -->_2 #eq^#(#s(@x), #s(@y)) -> c_77(#eq^#(@x, @y)) :77 -->_3 #eq^#(#s(@x), #0()) -> c_76() :76 -->_2 #eq^#(#s(@x), #0()) -> c_76() :76 -->_3 #eq^#(#pos(@x), #pos(@y)) -> c_75(#eq^#(@x, @y)) :75 -->_2 #eq^#(#pos(@x), #pos(@y)) -> c_75(#eq^#(@x, @y)) :75 -->_3 #eq^#(#pos(@x), #neg(@y)) -> c_74() :74 -->_2 #eq^#(#pos(@x), #neg(@y)) -> c_74() :74 -->_3 #eq^#(#pos(@x), #0()) -> c_73() :73 -->_2 #eq^#(#pos(@x), #0()) -> c_73() :73 -->_3 #eq^#(#neg(@x), #pos(@y)) -> c_72() :72 -->_2 #eq^#(#neg(@x), #pos(@y)) -> c_72() :72 -->_3 #eq^#(#neg(@x), #neg(@y)) -> c_71(#eq^#(@x, @y)) :71 -->_2 #eq^#(#neg(@x), #neg(@y)) -> c_71(#eq^#(@x, @y)) :71 -->_3 #eq^#(#neg(@x), #0()) -> c_70() :70 -->_2 #eq^#(#neg(@x), #0()) -> c_70() :70 -->_3 #eq^#(#0(), #s(@y)) -> c_69() :69 -->_2 #eq^#(#0(), #s(@y)) -> c_69() :69 -->_3 #eq^#(#0(), #pos(@y)) -> c_68() :68 -->_2 #eq^#(#0(), #pos(@y)) -> c_68() :68 -->_3 #eq^#(#0(), #neg(@y)) -> c_67() :67 -->_2 #eq^#(#0(), #neg(@y)) -> c_67() :67 -->_3 #eq^#(#0(), #0()) -> c_66() :66 -->_2 #eq^#(#0(), #0()) -> c_66() :66 79: #eq^#(::(@x_1, @x_2), nil()) -> c_79() 80: #eq^#(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> c_80() 81: #eq^#(nil(), ::(@y_1, @y_2)) -> c_81() 82: #eq^#(nil(), nil()) -> c_82() 83: #eq^#(nil(), tuple#2(@y_1, @y_2)) -> c_83() 84: #eq^#(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> c_84() 85: #eq^#(tuple#2(@x_1, @x_2), nil()) -> c_85() 86: #eq^#(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> c_86(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)), #eq^#(@x_1, @y_1), #eq^#(@x_2, @y_2)) -->_1 #and^#(#true(), #true()) -> c_142() :134 -->_1 #and^#(#true(), #false()) -> c_141() :133 -->_1 #and^#(#false(), #true()) -> c_140() :132 -->_1 #and^#(#false(), #false()) -> c_139() :131 -->_3 #eq^#(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> c_86(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)), #eq^#(@x_1, @y_1), #eq^#(@x_2, @y_2)) :86 -->_2 #eq^#(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> c_86(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)), #eq^#(@x_1, @y_1), #eq^#(@x_2, @y_2)) :86 -->_3 #eq^#(tuple#2(@x_1, @x_2), nil()) -> c_85() :85 -->_2 #eq^#(tuple#2(@x_1, @x_2), nil()) -> c_85() :85 -->_3 #eq^#(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> c_84() :84 -->_2 #eq^#(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> c_84() :84 -->_3 #eq^#(nil(), tuple#2(@y_1, @y_2)) -> c_83() :83 -->_2 #eq^#(nil(), tuple#2(@y_1, @y_2)) -> c_83() :83 -->_3 #eq^#(nil(), nil()) -> c_82() :82 -->_2 #eq^#(nil(), nil()) -> c_82() :82 -->_3 #eq^#(nil(), ::(@y_1, @y_2)) -> c_81() :81 -->_2 #eq^#(nil(), ::(@y_1, @y_2)) -> c_81() :81 -->_3 #eq^#(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> c_80() :80 -->_2 #eq^#(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> c_80() :80 -->_3 #eq^#(::(@x_1, @x_2), nil()) -> c_79() :79 -->_2 #eq^#(::(@x_1, @x_2), nil()) -> c_79() :79 -->_3 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) -> c_78(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)), #eq^#(@x_1, @y_1), #eq^#(@x_2, @y_2)) :78 -->_2 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) -> c_78(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)), #eq^#(@x_1, @y_1), #eq^#(@x_2, @y_2)) :78 -->_3 #eq^#(#s(@x), #s(@y)) -> c_77(#eq^#(@x, @y)) :77 -->_2 #eq^#(#s(@x), #s(@y)) -> c_77(#eq^#(@x, @y)) :77 -->_3 #eq^#(#s(@x), #0()) -> c_76() :76 -->_2 #eq^#(#s(@x), #0()) -> c_76() :76 -->_3 #eq^#(#pos(@x), #pos(@y)) -> c_75(#eq^#(@x, @y)) :75 -->_2 #eq^#(#pos(@x), #pos(@y)) -> c_75(#eq^#(@x, @y)) :75 -->_3 #eq^#(#pos(@x), #neg(@y)) -> c_74() :74 -->_2 #eq^#(#pos(@x), #neg(@y)) -> c_74() :74 -->_3 #eq^#(#pos(@x), #0()) -> c_73() :73 -->_2 #eq^#(#pos(@x), #0()) -> c_73() :73 -->_3 #eq^#(#neg(@x), #pos(@y)) -> c_72() :72 -->_2 #eq^#(#neg(@x), #pos(@y)) -> c_72() :72 -->_3 #eq^#(#neg(@x), #neg(@y)) -> c_71(#eq^#(@x, @y)) :71 -->_2 #eq^#(#neg(@x), #neg(@y)) -> c_71(#eq^#(@x, @y)) :71 -->_3 #eq^#(#neg(@x), #0()) -> c_70() :70 -->_2 #eq^#(#neg(@x), #0()) -> c_70() :70 -->_3 #eq^#(#0(), #s(@y)) -> c_69() :69 -->_2 #eq^#(#0(), #s(@y)) -> c_69() :69 -->_3 #eq^#(#0(), #pos(@y)) -> c_68() :68 -->_2 #eq^#(#0(), #pos(@y)) -> c_68() :68 -->_3 #eq^#(#0(), #neg(@y)) -> c_67() :67 -->_2 #eq^#(#0(), #neg(@y)) -> c_67() :67 -->_3 #eq^#(#0(), #0()) -> c_66() :66 -->_2 #eq^#(#0(), #0()) -> c_66() :66 87: #ckgt^#(#EQ()) -> c_99() 88: #ckgt^#(#GT()) -> c_100() 89: #ckgt^#(#LT()) -> c_101() 90: #compare^#(#0(), #0()) -> c_87() 91: #compare^#(#0(), #neg(@y)) -> c_88() 92: #compare^#(#0(), #pos(@y)) -> c_89() 93: #compare^#(#0(), #s(@y)) -> c_90() 94: #compare^#(#neg(@x), #0()) -> c_91() 95: #compare^#(#neg(@x), #neg(@y)) -> c_92(#compare^#(@y, @x)) -->_1 #compare^#(#s(@x), #s(@y)) -> c_98(#compare^#(@x, @y)) :101 -->_1 #compare^#(#pos(@x), #pos(@y)) -> c_96(#compare^#(@x, @y)) :99 -->_1 #compare^#(#s(@x), #0()) -> c_97() :100 -->_1 #compare^#(#pos(@x), #neg(@y)) -> c_95() :98 -->_1 #compare^#(#pos(@x), #0()) -> c_94() :97 -->_1 #compare^#(#neg(@x), #pos(@y)) -> c_93() :96 -->_1 #compare^#(#neg(@x), #neg(@y)) -> c_92(#compare^#(@y, @x)) :95 -->_1 #compare^#(#neg(@x), #0()) -> c_91() :94 -->_1 #compare^#(#0(), #s(@y)) -> c_90() :93 -->_1 #compare^#(#0(), #pos(@y)) -> c_89() :92 -->_1 #compare^#(#0(), #neg(@y)) -> c_88() :91 -->_1 #compare^#(#0(), #0()) -> c_87() :90 96: #compare^#(#neg(@x), #pos(@y)) -> c_93() 97: #compare^#(#pos(@x), #0()) -> c_94() 98: #compare^#(#pos(@x), #neg(@y)) -> c_95() 99: #compare^#(#pos(@x), #pos(@y)) -> c_96(#compare^#(@x, @y)) -->_1 #compare^#(#s(@x), #s(@y)) -> c_98(#compare^#(@x, @y)) :101 -->_1 #compare^#(#s(@x), #0()) -> c_97() :100 -->_1 #compare^#(#pos(@x), #pos(@y)) -> c_96(#compare^#(@x, @y)) :99 -->_1 #compare^#(#pos(@x), #neg(@y)) -> c_95() :98 -->_1 #compare^#(#pos(@x), #0()) -> c_94() :97 -->_1 #compare^#(#neg(@x), #pos(@y)) -> c_93() :96 -->_1 #compare^#(#neg(@x), #neg(@y)) -> c_92(#compare^#(@y, @x)) :95 -->_1 #compare^#(#neg(@x), #0()) -> c_91() :94 -->_1 #compare^#(#0(), #s(@y)) -> c_90() :93 -->_1 #compare^#(#0(), #pos(@y)) -> c_89() :92 -->_1 #compare^#(#0(), #neg(@y)) -> c_88() :91 -->_1 #compare^#(#0(), #0()) -> c_87() :90 100: #compare^#(#s(@x), #0()) -> c_97() 101: #compare^#(#s(@x), #s(@y)) -> c_98(#compare^#(@x, @y)) -->_1 #compare^#(#s(@x), #s(@y)) -> c_98(#compare^#(@x, @y)) :101 -->_1 #compare^#(#s(@x), #0()) -> c_97() :100 -->_1 #compare^#(#pos(@x), #pos(@y)) -> c_96(#compare^#(@x, @y)) :99 -->_1 #compare^#(#pos(@x), #neg(@y)) -> c_95() :98 -->_1 #compare^#(#pos(@x), #0()) -> c_94() :97 -->_1 #compare^#(#neg(@x), #pos(@y)) -> c_93() :96 -->_1 #compare^#(#neg(@x), #neg(@y)) -> c_92(#compare^#(@y, @x)) :95 -->_1 #compare^#(#neg(@x), #0()) -> c_91() :94 -->_1 #compare^#(#0(), #s(@y)) -> c_90() :93 -->_1 #compare^#(#0(), #pos(@y)) -> c_89() :92 -->_1 #compare^#(#0(), #neg(@y)) -> c_88() :91 -->_1 #compare^#(#0(), #0()) -> c_87() :90 102: #cklt^#(#EQ()) -> c_102() 103: #cklt^#(#GT()) -> c_103() 104: #cklt^#(#LT()) -> c_104() 105: #mult^#(#0(), #0()) -> c_105() 106: #mult^#(#0(), #neg(@y)) -> c_106() 107: #mult^#(#0(), #pos(@y)) -> c_107() 108: #mult^#(#neg(@x), #0()) -> c_108() 109: #mult^#(#neg(@x), #neg(@y)) -> c_109(#natmult^#(@x, @y)) -->_1 #natmult^#(#s(@x), @y) -> c_160(#natadd^#(@y, #natmult(@x, @y)), #natmult^#(@x, @y)) :136 -->_1 #natmult^#(#0(), @y) -> c_159() :135 110: #mult^#(#neg(@x), #pos(@y)) -> c_110(#natmult^#(@x, @y)) -->_1 #natmult^#(#s(@x), @y) -> c_160(#natadd^#(@y, #natmult(@x, @y)), #natmult^#(@x, @y)) :136 -->_1 #natmult^#(#0(), @y) -> c_159() :135 111: #mult^#(#pos(@x), #0()) -> c_111() 112: #mult^#(#pos(@x), #neg(@y)) -> c_112(#natmult^#(@x, @y)) -->_1 #natmult^#(#s(@x), @y) -> c_160(#natadd^#(@y, #natmult(@x, @y)), #natmult^#(@x, @y)) :136 -->_1 #natmult^#(#0(), @y) -> c_159() :135 113: #mult^#(#pos(@x), #pos(@y)) -> c_113(#natmult^#(@x, @y)) -->_1 #natmult^#(#s(@x), @y) -> c_160(#natadd^#(@y, #natmult(@x, @y)), #natmult^#(@x, @y)) :136 -->_1 #natmult^#(#0(), @y) -> c_159() :135 114: #add^#(#0(), @y) -> c_114() 115: #add^#(#neg(#s(#0())), @y) -> c_115(#pred^#(@y)) -->_1 #pred^#(#pos(#s(#s(@x)))) -> c_134() :140 -->_1 #pred^#(#pos(#s(#0()))) -> c_133() :139 -->_1 #pred^#(#neg(#s(@x))) -> c_132() :138 -->_1 #pred^#(#0()) -> c_131() :137 116: #add^#(#neg(#s(#s(@x))), @y) -> c_116(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) -->_2 #add^#(#pos(#s(#s(@x))), @y) -> c_118(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :118 -->_2 #add^#(#pos(#s(#0())), @y) -> c_117(#succ^#(@y)) :117 -->_1 #pred^#(#pos(#s(#s(@x)))) -> c_134() :140 -->_1 #pred^#(#pos(#s(#0()))) -> c_133() :139 -->_1 #pred^#(#neg(#s(@x))) -> c_132() :138 -->_1 #pred^#(#0()) -> c_131() :137 117: #add^#(#pos(#s(#0())), @y) -> c_117(#succ^#(@y)) -->_1 #succ^#(#pos(#s(@x))) -> c_138() :144 -->_1 #succ^#(#neg(#s(#s(@x)))) -> c_137() :143 -->_1 #succ^#(#neg(#s(#0()))) -> c_136() :142 -->_1 #succ^#(#0()) -> c_135() :141 118: #add^#(#pos(#s(#s(@x))), @y) -> c_118(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) -->_1 #succ^#(#pos(#s(@x))) -> c_138() :144 -->_1 #succ^#(#neg(#s(#s(@x)))) -> c_137() :143 -->_1 #succ^#(#neg(#s(#0()))) -> c_136() :142 -->_1 #succ^#(#0()) -> c_135() :141 -->_2 #add^#(#pos(#s(#s(@x))), @y) -> c_118(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :118 -->_2 #add^#(#pos(#s(#0())), @y) -> c_117(#succ^#(@y)) :117 119: #sub^#(@x, #0()) -> c_119() 120: #sub^#(@x, #neg(@y)) -> c_120(#add^#(@x, #pos(@y))) -->_1 #add^#(#pos(#s(#s(@x))), @y) -> c_118(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :118 -->_1 #add^#(#pos(#s(#0())), @y) -> c_117(#succ^#(@y)) :117 -->_1 #add^#(#neg(#s(#s(@x))), @y) -> c_116(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :116 -->_1 #add^#(#neg(#s(#0())), @y) -> c_115(#pred^#(@y)) :115 -->_1 #add^#(#0(), @y) -> c_114() :114 121: #sub^#(@x, #pos(@y)) -> c_121(#add^#(@x, #neg(@y))) -->_1 #add^#(#pos(#s(#s(@x))), @y) -> c_118(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :118 -->_1 #add^#(#pos(#s(#0())), @y) -> c_117(#succ^#(@y)) :117 -->_1 #add^#(#neg(#s(#s(@x))), @y) -> c_116(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :116 -->_1 #add^#(#neg(#s(#0())), @y) -> c_115(#pred^#(@y)) :115 -->_1 #add^#(#0(), @y) -> c_114() :114 122: #div^#(#0(), #0()) -> c_122() 123: #div^#(#0(), #neg(@y)) -> c_123() 124: #div^#(#0(), #pos(@y)) -> c_124() 125: #div^#(#neg(@x), #0()) -> c_125() 126: #div^#(#neg(@x), #neg(@y)) -> c_126(#positive^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) -->_2 #natdiv^#(#s(@x), #s(@y)) -> c_146(#natdiv'^#(#divsub(@x, @y), #s(@y)), #divsub^#(@x, @y)) :152 -->_2 #natdiv^#(#s(@x), #0()) -> c_145() :151 -->_2 #natdiv^#(#0(), #s(@y)) -> c_144() :150 -->_2 #natdiv^#(#0(), #0()) -> c_143() :149 -->_1 #positive^#(#s(@x)) -> c_150() :148 -->_1 #positive^#(#pos(@x)) -> c_149() :147 -->_1 #positive^#(#neg(@x)) -> c_148() :146 -->_1 #positive^#(#0()) -> c_147() :145 127: #div^#(#neg(@x), #pos(@y)) -> c_127(#negative^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) -->_2 #natdiv^#(#s(@x), #s(@y)) -> c_146(#natdiv'^#(#divsub(@x, @y), #s(@y)), #divsub^#(@x, @y)) :152 -->_1 #negative^#(#s(@x)) -> c_154() :156 -->_1 #negative^#(#pos(@x)) -> c_153() :155 -->_1 #negative^#(#neg(@x)) -> c_152() :154 -->_1 #negative^#(#0()) -> c_151() :153 -->_2 #natdiv^#(#s(@x), #0()) -> c_145() :151 -->_2 #natdiv^#(#0(), #s(@y)) -> c_144() :150 -->_2 #natdiv^#(#0(), #0()) -> c_143() :149 128: #div^#(#pos(@x), #0()) -> c_128() 129: #div^#(#pos(@x), #neg(@y)) -> c_129(#negative^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) -->_2 #natdiv^#(#s(@x), #s(@y)) -> c_146(#natdiv'^#(#divsub(@x, @y), #s(@y)), #divsub^#(@x, @y)) :152 -->_1 #negative^#(#s(@x)) -> c_154() :156 -->_1 #negative^#(#pos(@x)) -> c_153() :155 -->_1 #negative^#(#neg(@x)) -> c_152() :154 -->_1 #negative^#(#0()) -> c_151() :153 -->_2 #natdiv^#(#s(@x), #0()) -> c_145() :151 -->_2 #natdiv^#(#0(), #s(@y)) -> c_144() :150 -->_2 #natdiv^#(#0(), #0()) -> c_143() :149 130: #div^#(#pos(@x), #pos(@y)) -> c_130(#positive^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) -->_2 #natdiv^#(#s(@x), #s(@y)) -> c_146(#natdiv'^#(#divsub(@x, @y), #s(@y)), #divsub^#(@x, @y)) :152 -->_2 #natdiv^#(#s(@x), #0()) -> c_145() :151 -->_2 #natdiv^#(#0(), #s(@y)) -> c_144() :150 -->_2 #natdiv^#(#0(), #0()) -> c_143() :149 -->_1 #positive^#(#s(@x)) -> c_150() :148 -->_1 #positive^#(#pos(@x)) -> c_149() :147 -->_1 #positive^#(#neg(@x)) -> c_148() :146 -->_1 #positive^#(#0()) -> c_147() :145 131: #and^#(#false(), #false()) -> c_139() 132: #and^#(#false(), #true()) -> c_140() 133: #and^#(#true(), #false()) -> c_141() 134: #and^#(#true(), #true()) -> c_142() 135: #natmult^#(#0(), @y) -> c_159() 136: #natmult^#(#s(@x), @y) -> c_160(#natadd^#(@y, #natmult(@x, @y)), #natmult^#(@x, @y)) -->_1 #natadd^#(#s(@x), @y) -> c_162(#natadd^#(@x, @y)) :165 -->_1 #natadd^#(#0(), @y) -> c_161() :164 -->_2 #natmult^#(#s(@x), @y) -> c_160(#natadd^#(@y, #natmult(@x, @y)), #natmult^#(@x, @y)) :136 -->_2 #natmult^#(#0(), @y) -> c_159() :135 137: #pred^#(#0()) -> c_131() 138: #pred^#(#neg(#s(@x))) -> c_132() 139: #pred^#(#pos(#s(#0()))) -> c_133() 140: #pred^#(#pos(#s(#s(@x)))) -> c_134() 141: #succ^#(#0()) -> c_135() 142: #succ^#(#neg(#s(#0()))) -> c_136() 143: #succ^#(#neg(#s(#s(@x)))) -> c_137() 144: #succ^#(#pos(#s(@x))) -> c_138() 145: #positive^#(#0()) -> c_147() 146: #positive^#(#neg(@x)) -> c_148() 147: #positive^#(#pos(@x)) -> c_149() 148: #positive^#(#s(@x)) -> c_150() 149: #natdiv^#(#0(), #0()) -> c_143() 150: #natdiv^#(#0(), #s(@y)) -> c_144() 151: #natdiv^#(#s(@x), #0()) -> c_145() 152: #natdiv^#(#s(@x), #s(@y)) -> c_146(#natdiv'^#(#divsub(@x, @y), #s(@y)), #divsub^#(@x, @y)) -->_2 #divsub^#(#s(@x), #s(@y)) -> c_158(#divsub^#(@x, @y)) :163 -->_1 #natdiv'^#(#s(@x), @y) -> c_164(#natdiv^#(#s(@x), @y)) :158 -->_2 #divsub^#(#s(@x), #0()) -> c_157() :162 -->_2 #divsub^#(#0(), #s(@y)) -> c_156() :161 -->_2 #divsub^#(#0(), #0()) -> c_155() :160 -->_1 #natdiv'^#(#underflow(), @y) -> c_165() :159 -->_1 #natdiv'^#(#0(), @y) -> c_163() :157 153: #negative^#(#0()) -> c_151() 154: #negative^#(#neg(@x)) -> c_152() 155: #negative^#(#pos(@x)) -> c_153() 156: #negative^#(#s(@x)) -> c_154() 157: #natdiv'^#(#0(), @y) -> c_163() 158: #natdiv'^#(#s(@x), @y) -> c_164(#natdiv^#(#s(@x), @y)) -->_1 #natdiv^#(#s(@x), #s(@y)) -> c_146(#natdiv'^#(#divsub(@x, @y), #s(@y)), #divsub^#(@x, @y)) :152 -->_1 #natdiv^#(#s(@x), #0()) -> c_145() :151 159: #natdiv'^#(#underflow(), @y) -> c_165() 160: #divsub^#(#0(), #0()) -> c_155() 161: #divsub^#(#0(), #s(@y)) -> c_156() 162: #divsub^#(#s(@x), #0()) -> c_157() 163: #divsub^#(#s(@x), #s(@y)) -> c_158(#divsub^#(@x, @y)) -->_1 #divsub^#(#s(@x), #s(@y)) -> c_158(#divsub^#(@x, @y)) :163 -->_1 #divsub^#(#s(@x), #0()) -> c_157() :162 -->_1 #divsub^#(#0(), #s(@y)) -> c_156() :161 -->_1 #divsub^#(#0(), #0()) -> c_155() :160 164: #natadd^#(#0(), @y) -> c_161() 165: #natadd^#(#s(@x), @y) -> c_162(#natadd^#(@x, @y)) -->_1 #natadd^#(#s(@x), @y) -> c_162(#natadd^#(@x, @y)) :165 -->_1 #natadd^#(#0(), @y) -> c_161() :164 166: #natsub^#(@x, #0()) -> c_166() 167: #natsub^#(#s(@x), #s(@y)) -> c_167(#natsub^#(@x, @y)) -->_1 #natsub^#(#s(@x), #s(@y)) -> c_167(#natsub^#(@x, @y)) :167 -->_1 #natsub^#(@x, #0()) -> c_166() :166 Following roots of the dependency graph are removed, as the considered set of starting terms is closed under reduction with respect to these rules (modulo compound contexts). { #abs^#(#neg(@x)) -> c_2() , #abs^#(#s(@x)) -> c_4() } We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^2)). Strict DPs: { #abs^#(#0()) -> c_1() , #abs^#(#pos(@x)) -> c_3() , #equal^#(@x, @y) -> c_5(#eq^#(@x, @y)) , #greater^#(@x, @y) -> c_6(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y)) , #less^#(@x, @y) -> c_7(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y)) , *^#(@x, @y) -> c_8(#mult^#(@x, @y)) , +^#(@x, @y) -> c_9(#add^#(@x, @y)) , -^#(@x, @y) -> c_10(#sub^#(@x, @y)) , add^#(@b1, @b2) -> c_11(add'^#(@b1, @b2, #abs(#0())), #abs^#(#0())) , add'^#(@b1, @b2, @r) -> c_12(add'#1^#(@b1, @b2, @r)) , add'#1^#(::(@x, @xs), @b2, @r) -> c_13(add'#2^#(@b2, @r, @x, @xs)) , add'#1^#(nil(), @b2, @r) -> c_14() , add'#2^#(::(@y, @ys), @r, @x, @xs) -> c_15(add'#3^#(sum(@x, @y, @r), @xs, @ys), sum^#(@x, @y, @r)) , add'#2^#(nil(), @r, @x, @xs) -> c_16() , add'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_18(add'^#(@xs, @ys, @r')) , sum^#(@x, @y, @r) -> c_17(sum#1^#(+(+(@x, @y), @r)), +^#(+(@x, @y), @r), +^#(@x, @y)) , sum#1^#(@s) -> c_59(sum#2^#(#equal(@s, #0()), @s), #equal^#(@s, #0())) , bitToInt^#(@b) -> c_19(bitToInt'^#(@b, #abs(#pos(#s(#0())))), #abs^#(#pos(#s(#0())))) , bitToInt'^#(@b, @n) -> c_20(bitToInt'#1^#(@b, @n)) , bitToInt'#1^#(::(@x, @xs), @n) -> c_21(+^#(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))), *^#(@x, @n), bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))), *^#(@n, #pos(#s(#s(#0()))))) , bitToInt'#1^#(nil(), @n) -> c_22(#abs^#(#0())) , compare^#(@b1, @b2) -> c_23(compare#1^#(@b1, @b2)) , compare#1^#(::(@x, @xs), @b2) -> c_24(compare#2^#(@b2, @x, @xs)) , compare#1^#(nil(), @b2) -> c_25(#abs^#(#0())) , compare#2^#(::(@y, @ys), @x, @xs) -> c_26(compare#3^#(compare(@xs, @ys), @x, @y), compare^#(@xs, @ys)) , compare#2^#(nil(), @x, @xs) -> c_27(#abs^#(#0())) , compare#3^#(@r, @x, @y) -> c_28(compare#4^#(#equal(@r, #0()), @r, @x, @y), #equal^#(@r, #0())) , compare#4^#(#false(), @r, @x, @y) -> c_29() , compare#4^#(#true(), @r, @x, @y) -> c_30(compare#5^#(#less(@x, @y), @x, @y), #less^#(@x, @y)) , compare#5^#(#false(), @x, @y) -> c_31(compare#6^#(#greater(@x, @y)), #greater^#(@x, @y)) , compare#5^#(#true(), @x, @y) -> c_32(-^#(#0(), #pos(#s(#0())))) , compare#6^#(#false()) -> c_33(#abs^#(#0())) , compare#6^#(#true()) -> c_34(#abs^#(#pos(#s(#0())))) , diff^#(@x, @y, @r) -> c_35(mod^#(+(+(@x, @y), @r), #pos(#s(#s(#0())))), +^#(+(@x, @y), @r), +^#(@x, @y), diff#1^#(#less(-(-(@x, @y), @r), #0())), #less^#(-(-(@x, @y), @r), #0()), -^#(-(@x, @y), @r), -^#(@x, @y)) , mod^#(@x, @y) -> c_36(-^#(@x, *(@y, div(@x, @y))), *^#(@y, div(@x, @y)), div^#(@x, @y)) , diff#1^#(#false()) -> c_37(#abs^#(#0())) , diff#1^#(#true()) -> c_38(#abs^#(#pos(#s(#0())))) , div^#(@x, @y) -> c_39(#div^#(@x, @y)) , leq^#(@b1, @b2) -> c_40(#less^#(compare(@b1, @b2), #pos(#s(#0()))), compare^#(@b1, @b2)) , mult^#(@b1, @b2) -> c_41(mult#1^#(@b1, @b2)) , mult#1^#(::(@x, @xs), @b2) -> c_42(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x), #abs^#(#0()), mult^#(@xs, @b2)) , mult#1^#(nil(), @b2) -> c_43() , mult#2^#(@zs, @b2, @x) -> c_44(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs), #equal^#(@x, #pos(#s(#0())))) , mult#3^#(#false(), @b2, @zs) -> c_45() , mult#3^#(#true(), @b2, @zs) -> c_46(add^#(@b2, @zs)) , mult3^#(@b1, @b2, @b3) -> c_47(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2)) , sub^#(@b1, @b2) -> c_48(sub#1^#(sub'(@b1, @b2, #abs(#0()))), sub'^#(@b1, @b2, #abs(#0())), #abs^#(#0())) , sub#1^#(tuple#2(@b, @_@1)) -> c_50() , sub'^#(@b1, @b2, @r) -> c_49(sub'#1^#(@b1, @b2, @r)) , sub'#1^#(::(@x, @xs), @b2, @r) -> c_51(sub'#2^#(@b2, @r, @x, @xs)) , sub'#1^#(nil(), @b2, @r) -> c_52() , sub'#2^#(::(@y, @ys), @r, @x, @xs) -> c_53(sub'#3^#(diff(@x, @y, @r), @xs, @ys), diff^#(@x, @y, @r)) , sub'#2^#(nil(), @r, @x, @xs) -> c_54() , sub'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_55(sub'#4^#(sub'(@xs, @ys, @r'), @z), sub'^#(@xs, @ys, @r')) , sub'#4^#(tuple#2(@zs, @s), @z) -> c_56(sub'#5^#(#equal(@s, #pos(#s(#0()))), @z, @zs), #equal^#(@s, #pos(#s(#0())))) , sub'#5^#(#false(), @z, @zs) -> c_57() , sub'#5^#(#true(), @z, @zs) -> c_58(#abs^#(#0())) , sum#2^#(#false(), @s) -> c_60(sum#3^#(#equal(@s, #pos(#s(#0()))), @s), #equal^#(@s, #pos(#s(#0())))) , sum#2^#(#true(), @s) -> c_61(#abs^#(#0()), #abs^#(#0())) , sum#3^#(#false(), @s) -> c_62(sum#4^#(#equal(@s, #pos(#s(#s(#0()))))), #equal^#(@s, #pos(#s(#s(#0()))))) , sum#3^#(#true(), @s) -> c_63(#abs^#(#pos(#s(#0()))), #abs^#(#0())) , sum#4^#(#false()) -> c_64(#abs^#(#pos(#s(#0()))), #abs^#(#pos(#s(#0())))) , sum#4^#(#true()) -> c_65(#abs^#(#0()), #abs^#(#pos(#s(#0())))) } Weak DPs: { #eq^#(#0(), #0()) -> c_66() , #eq^#(#0(), #neg(@y)) -> c_67() , #eq^#(#0(), #pos(@y)) -> c_68() , #eq^#(#0(), #s(@y)) -> c_69() , #eq^#(#neg(@x), #0()) -> c_70() , #eq^#(#neg(@x), #neg(@y)) -> c_71(#eq^#(@x, @y)) , #eq^#(#neg(@x), #pos(@y)) -> c_72() , #eq^#(#pos(@x), #0()) -> c_73() , #eq^#(#pos(@x), #neg(@y)) -> c_74() , #eq^#(#pos(@x), #pos(@y)) -> c_75(#eq^#(@x, @y)) , #eq^#(#s(@x), #0()) -> c_76() , #eq^#(#s(@x), #s(@y)) -> c_77(#eq^#(@x, @y)) , #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) -> c_78(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)), #eq^#(@x_1, @y_1), #eq^#(@x_2, @y_2)) , #eq^#(::(@x_1, @x_2), nil()) -> c_79() , #eq^#(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> c_80() , #eq^#(nil(), ::(@y_1, @y_2)) -> c_81() , #eq^#(nil(), nil()) -> c_82() , #eq^#(nil(), tuple#2(@y_1, @y_2)) -> c_83() , #eq^#(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> c_84() , #eq^#(tuple#2(@x_1, @x_2), nil()) -> c_85() , #eq^#(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> c_86(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)), #eq^#(@x_1, @y_1), #eq^#(@x_2, @y_2)) , #ckgt^#(#EQ()) -> c_99() , #ckgt^#(#GT()) -> c_100() , #ckgt^#(#LT()) -> c_101() , #compare^#(#0(), #0()) -> c_87() , #compare^#(#0(), #neg(@y)) -> c_88() , #compare^#(#0(), #pos(@y)) -> c_89() , #compare^#(#0(), #s(@y)) -> c_90() , #compare^#(#neg(@x), #0()) -> c_91() , #compare^#(#neg(@x), #neg(@y)) -> c_92(#compare^#(@y, @x)) , #compare^#(#neg(@x), #pos(@y)) -> c_93() , #compare^#(#pos(@x), #0()) -> c_94() , #compare^#(#pos(@x), #neg(@y)) -> c_95() , #compare^#(#pos(@x), #pos(@y)) -> c_96(#compare^#(@x, @y)) , #compare^#(#s(@x), #0()) -> c_97() , #compare^#(#s(@x), #s(@y)) -> c_98(#compare^#(@x, @y)) , #cklt^#(#EQ()) -> c_102() , #cklt^#(#GT()) -> c_103() , #cklt^#(#LT()) -> c_104() , #mult^#(#0(), #0()) -> c_105() , #mult^#(#0(), #neg(@y)) -> c_106() , #mult^#(#0(), #pos(@y)) -> c_107() , #mult^#(#neg(@x), #0()) -> c_108() , #mult^#(#neg(@x), #neg(@y)) -> c_109(#natmult^#(@x, @y)) , #mult^#(#neg(@x), #pos(@y)) -> c_110(#natmult^#(@x, @y)) , #mult^#(#pos(@x), #0()) -> c_111() , #mult^#(#pos(@x), #neg(@y)) -> c_112(#natmult^#(@x, @y)) , #mult^#(#pos(@x), #pos(@y)) -> c_113(#natmult^#(@x, @y)) , #add^#(#0(), @y) -> c_114() , #add^#(#neg(#s(#0())), @y) -> c_115(#pred^#(@y)) , #add^#(#neg(#s(#s(@x))), @y) -> c_116(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) , #add^#(#pos(#s(#0())), @y) -> c_117(#succ^#(@y)) , #add^#(#pos(#s(#s(@x))), @y) -> c_118(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) , #sub^#(@x, #0()) -> c_119() , #sub^#(@x, #neg(@y)) -> c_120(#add^#(@x, #pos(@y))) , #sub^#(@x, #pos(@y)) -> c_121(#add^#(@x, #neg(@y))) , #div^#(#0(), #0()) -> c_122() , #div^#(#0(), #neg(@y)) -> c_123() , #div^#(#0(), #pos(@y)) -> c_124() , #div^#(#neg(@x), #0()) -> c_125() , #div^#(#neg(@x), #neg(@y)) -> c_126(#positive^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) , #div^#(#neg(@x), #pos(@y)) -> c_127(#negative^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) , #div^#(#pos(@x), #0()) -> c_128() , #div^#(#pos(@x), #neg(@y)) -> c_129(#negative^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) , #div^#(#pos(@x), #pos(@y)) -> c_130(#positive^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) , #and^#(#false(), #false()) -> c_139() , #and^#(#false(), #true()) -> c_140() , #and^#(#true(), #false()) -> c_141() , #and^#(#true(), #true()) -> c_142() , #natmult^#(#0(), @y) -> c_159() , #natmult^#(#s(@x), @y) -> c_160(#natadd^#(@y, #natmult(@x, @y)), #natmult^#(@x, @y)) , #pred^#(#0()) -> c_131() , #pred^#(#neg(#s(@x))) -> c_132() , #pred^#(#pos(#s(#0()))) -> c_133() , #pred^#(#pos(#s(#s(@x)))) -> c_134() , #succ^#(#0()) -> c_135() , #succ^#(#neg(#s(#0()))) -> c_136() , #succ^#(#neg(#s(#s(@x)))) -> c_137() , #succ^#(#pos(#s(@x))) -> c_138() , #positive^#(#0()) -> c_147() , #positive^#(#neg(@x)) -> c_148() , #positive^#(#pos(@x)) -> c_149() , #positive^#(#s(@x)) -> c_150() , #natdiv^#(#0(), #0()) -> c_143() , #natdiv^#(#0(), #s(@y)) -> c_144() , #natdiv^#(#s(@x), #0()) -> c_145() , #natdiv^#(#s(@x), #s(@y)) -> c_146(#natdiv'^#(#divsub(@x, @y), #s(@y)), #divsub^#(@x, @y)) , #negative^#(#0()) -> c_151() , #negative^#(#neg(@x)) -> c_152() , #negative^#(#pos(@x)) -> c_153() , #negative^#(#s(@x)) -> c_154() , #natdiv'^#(#0(), @y) -> c_163() , #natdiv'^#(#s(@x), @y) -> c_164(#natdiv^#(#s(@x), @y)) , #natdiv'^#(#underflow(), @y) -> c_165() , #divsub^#(#0(), #0()) -> c_155() , #divsub^#(#0(), #s(@y)) -> c_156() , #divsub^#(#s(@x), #0()) -> c_157() , #divsub^#(#s(@x), #s(@y)) -> c_158(#divsub^#(@x, @y)) , #natadd^#(#0(), @y) -> c_161() , #natadd^#(#s(@x), @y) -> c_162(#natadd^#(@x, @y)) , #natsub^#(@x, #0()) -> c_166() , #natsub^#(#s(@x), #s(@y)) -> c_167(#natsub^#(@x, @y)) } Weak Trs: { #abs(#0()) -> #0() , #abs(#neg(@x)) -> #pos(@x) , #abs(#pos(@x)) -> #pos(@x) , #abs(#s(@x)) -> #pos(#s(@x)) , #equal(@x, @y) -> #eq(@x, @y) , #eq(#0(), #0()) -> #true() , #eq(#0(), #neg(@y)) -> #false() , #eq(#0(), #pos(@y)) -> #false() , #eq(#0(), #s(@y)) -> #false() , #eq(#neg(@x), #0()) -> #false() , #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #pos(@y)) -> #false() , #eq(#pos(@x), #0()) -> #false() , #eq(#pos(@x), #neg(@y)) -> #false() , #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y) , #eq(#s(@x), #0()) -> #false() , #eq(#s(@x), #s(@y)) -> #eq(@x, @y) , #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #eq(::(@x_1, @x_2), nil()) -> #false() , #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false() , #eq(nil(), ::(@y_1, @y_2)) -> #false() , #eq(nil(), nil()) -> #true() , #eq(nil(), tuple#2(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), nil()) -> #false() , #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #greater(@x, @y) -> #ckgt(#compare(@x, @y)) , #compare(#0(), #0()) -> #EQ() , #compare(#0(), #neg(@y)) -> #GT() , #compare(#0(), #pos(@y)) -> #LT() , #compare(#0(), #s(@y)) -> #LT() , #compare(#neg(@x), #0()) -> #LT() , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x) , #compare(#neg(@x), #pos(@y)) -> #LT() , #compare(#pos(@x), #0()) -> #GT() , #compare(#pos(@x), #neg(@y)) -> #GT() , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y) , #compare(#s(@x), #0()) -> #GT() , #compare(#s(@x), #s(@y)) -> #compare(@x, @y) , #ckgt(#EQ()) -> #false() , #ckgt(#GT()) -> #true() , #ckgt(#LT()) -> #false() , #less(@x, @y) -> #cklt(#compare(@x, @y)) , #cklt(#EQ()) -> #false() , #cklt(#GT()) -> #false() , #cklt(#LT()) -> #true() , *(@x, @y) -> #mult(@x, @y) , #mult(#0(), #0()) -> #0() , #mult(#0(), #neg(@y)) -> #0() , #mult(#0(), #pos(@y)) -> #0() , #mult(#neg(@x), #0()) -> #0() , #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y)) , #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #0()) -> #0() , #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y)) , +(@x, @y) -> #add(@x, @y) , #add(#0(), @y) -> @y , #add(#neg(#s(#0())), @y) -> #pred(@y) , #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y)) , #add(#pos(#s(#0())), @y) -> #succ(@y) , #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y)) , -(@x, @y) -> #sub(@x, @y) , #sub(@x, #0()) -> @x , #sub(@x, #neg(@y)) -> #add(@x, #pos(@y)) , #sub(@x, #pos(@y)) -> #add(@x, #neg(@y)) , add(@b1, @b2) -> add'(@b1, @b2, #abs(#0())) , add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r) , add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs) , add'#1(nil(), @b2, @r) -> nil() , add'#2(::(@y, @ys), @r, @x, @xs) -> add'#3(sum(@x, @y, @r), @xs, @ys) , add'#2(nil(), @r, @x, @xs) -> nil() , sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r)) , add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r')) , bitToInt(@b) -> bitToInt'(@b, #abs(#pos(#s(#0())))) , bitToInt'(@b, @n) -> bitToInt'#1(@b, @n) , bitToInt'#1(::(@x, @xs), @n) -> +(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))) , bitToInt'#1(nil(), @n) -> #abs(#0()) , compare(@b1, @b2) -> compare#1(@b1, @b2) , compare#1(::(@x, @xs), @b2) -> compare#2(@b2, @x, @xs) , compare#1(nil(), @b2) -> #abs(#0()) , compare#2(::(@y, @ys), @x, @xs) -> compare#3(compare(@xs, @ys), @x, @y) , compare#2(nil(), @x, @xs) -> #abs(#0()) , compare#3(@r, @x, @y) -> compare#4(#equal(@r, #0()), @r, @x, @y) , compare#4(#false(), @r, @x, @y) -> @r , compare#4(#true(), @r, @x, @y) -> compare#5(#less(@x, @y), @x, @y) , compare#5(#false(), @x, @y) -> compare#6(#greater(@x, @y)) , compare#5(#true(), @x, @y) -> -(#0(), #pos(#s(#0()))) , compare#6(#false()) -> #abs(#0()) , compare#6(#true()) -> #abs(#pos(#s(#0()))) , diff(@x, @y, @r) -> tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))), diff#1(#less(-(-(@x, @y), @r), #0()))) , mod(@x, @y) -> -(@x, *(@y, div(@x, @y))) , diff#1(#false()) -> #abs(#0()) , diff#1(#true()) -> #abs(#pos(#s(#0()))) , div(@x, @y) -> #div(@x, @y) , #div(#0(), #0()) -> #divByZero() , #div(#0(), #neg(@y)) -> #0() , #div(#0(), #pos(@y)) -> #0() , #div(#neg(@x), #0()) -> #divByZero() , #div(#neg(@x), #neg(@y)) -> #positive(#natdiv(@x, @y)) , #div(#neg(@x), #pos(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #0()) -> #divByZero() , #div(#pos(@x), #neg(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #pos(@y)) -> #positive(#natdiv(@x, @y)) , leq(@b1, @b2) -> #less(compare(@b1, @b2), #pos(#s(#0()))) , mult(@b1, @b2) -> mult#1(@b1, @b2) , mult#1(::(@x, @xs), @b2) -> mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x) , mult#1(nil(), @b2) -> nil() , mult#2(@zs, @b2, @x) -> mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs) , mult#3(#false(), @b2, @zs) -> @zs , mult#3(#true(), @b2, @zs) -> add(@b2, @zs) , mult3(@b1, @b2, @b3) -> mult(mult(@b1, @b2), @b2) , sub(@b1, @b2) -> sub#1(sub'(@b1, @b2, #abs(#0()))) , sub'(@b1, @b2, @r) -> sub'#1(@b1, @b2, @r) , sub#1(tuple#2(@b, @_@1)) -> @b , sub'#1(::(@x, @xs), @b2, @r) -> sub'#2(@b2, @r, @x, @xs) , sub'#1(nil(), @b2, @r) -> tuple#2(nil(), @r) , sub'#2(::(@y, @ys), @r, @x, @xs) -> sub'#3(diff(@x, @y, @r), @xs, @ys) , sub'#2(nil(), @r, @x, @xs) -> tuple#2(nil(), @r) , sub'#3(tuple#2(@z, @r'), @xs, @ys) -> sub'#4(sub'(@xs, @ys, @r'), @z) , sub'#4(tuple#2(@zs, @s), @z) -> tuple#2(sub'#5(#equal(@s, #pos(#s(#0()))), @z, @zs), @s) , sub'#5(#false(), @z, @zs) -> ::(@z, @zs) , sub'#5(#true(), @z, @zs) -> ::(#abs(#0()), @zs) , sum#1(@s) -> sum#2(#equal(@s, #0()), @s) , sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s) , sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0())) , sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0()))))) , sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0())) , sum#4(#false()) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0())))) , sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0())))) , #pred(#0()) -> #neg(#s(#0())) , #pred(#neg(#s(@x))) -> #neg(#s(#s(@x))) , #pred(#pos(#s(#0()))) -> #0() , #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x)) , #succ(#0()) -> #pos(#s(#0())) , #succ(#neg(#s(#0()))) -> #0() , #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x)) , #succ(#pos(#s(@x))) -> #pos(#s(#s(@x))) , #and(#false(), #false()) -> #false() , #and(#false(), #true()) -> #false() , #and(#true(), #false()) -> #false() , #and(#true(), #true()) -> #true() , #natdiv(#0(), #0()) -> #divByZero() , #natdiv(#0(), #s(@y)) -> #0() , #natdiv(#s(@x), #0()) -> #divByZero() , #natdiv(#s(@x), #s(@y)) -> #natdiv'(#divsub(@x, @y), #s(@y)) , #positive(#0()) -> #0() , #positive(#neg(@x)) -> #neg(@x) , #positive(#pos(@x)) -> #pos(@x) , #positive(#s(@x)) -> #pos(#s(@x)) , #negative(#0()) -> #0() , #negative(#neg(@x)) -> #pos(@x) , #negative(#pos(@x)) -> #neg(@x) , #negative(#s(@x)) -> #neg(#s(@x)) , #divsub(#0(), #0()) -> #0() , #divsub(#0(), #s(@y)) -> #underflow() , #divsub(#s(@x), #0()) -> #s(@x) , #divsub(#s(@x), #s(@y)) -> #divsub(@x, @y) , #natmult(#0(), @y) -> #0() , #natmult(#s(@x), @y) -> #natadd(@y, #natmult(@x, @y)) , #natadd(#0(), @y) -> @y , #natadd(#s(@x), @y) -> #s(#natadd(@x, @y)) , #natdiv'(#0(), @y) -> #s(#0()) , #natdiv'(#s(@x), @y) -> #s(#natdiv(#s(@x), @y)) , #natdiv'(#underflow(), @y) -> #0() , #natsub(@x, #0()) -> @x , #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^2)) We estimate the number of application of {1,2,3,4,5,6,7,8,12,14,28,38,42,44,48,51,53,56} by applications of Pre({1,2,3,4,5,6,7,8,12,14,28,38,42,44,48,51,53,56}) = {9,10,11,16,17,18,20,21,24,26,27,29,30,31,32,33,34,35,36,37,39,40,41,43,47,49,50,55,57,58,59,60,61,62,63}. Here rules are labeled as follows: DPs: { 1: #abs^#(#0()) -> c_1() , 2: #abs^#(#pos(@x)) -> c_3() , 3: #equal^#(@x, @y) -> c_5(#eq^#(@x, @y)) , 4: #greater^#(@x, @y) -> c_6(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y)) , 5: #less^#(@x, @y) -> c_7(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y)) , 6: *^#(@x, @y) -> c_8(#mult^#(@x, @y)) , 7: +^#(@x, @y) -> c_9(#add^#(@x, @y)) , 8: -^#(@x, @y) -> c_10(#sub^#(@x, @y)) , 9: add^#(@b1, @b2) -> c_11(add'^#(@b1, @b2, #abs(#0())), #abs^#(#0())) , 10: add'^#(@b1, @b2, @r) -> c_12(add'#1^#(@b1, @b2, @r)) , 11: add'#1^#(::(@x, @xs), @b2, @r) -> c_13(add'#2^#(@b2, @r, @x, @xs)) , 12: add'#1^#(nil(), @b2, @r) -> c_14() , 13: add'#2^#(::(@y, @ys), @r, @x, @xs) -> c_15(add'#3^#(sum(@x, @y, @r), @xs, @ys), sum^#(@x, @y, @r)) , 14: add'#2^#(nil(), @r, @x, @xs) -> c_16() , 15: add'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_18(add'^#(@xs, @ys, @r')) , 16: sum^#(@x, @y, @r) -> c_17(sum#1^#(+(+(@x, @y), @r)), +^#(+(@x, @y), @r), +^#(@x, @y)) , 17: sum#1^#(@s) -> c_59(sum#2^#(#equal(@s, #0()), @s), #equal^#(@s, #0())) , 18: bitToInt^#(@b) -> c_19(bitToInt'^#(@b, #abs(#pos(#s(#0())))), #abs^#(#pos(#s(#0())))) , 19: bitToInt'^#(@b, @n) -> c_20(bitToInt'#1^#(@b, @n)) , 20: bitToInt'#1^#(::(@x, @xs), @n) -> c_21(+^#(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))), *^#(@x, @n), bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))), *^#(@n, #pos(#s(#s(#0()))))) , 21: bitToInt'#1^#(nil(), @n) -> c_22(#abs^#(#0())) , 22: compare^#(@b1, @b2) -> c_23(compare#1^#(@b1, @b2)) , 23: compare#1^#(::(@x, @xs), @b2) -> c_24(compare#2^#(@b2, @x, @xs)) , 24: compare#1^#(nil(), @b2) -> c_25(#abs^#(#0())) , 25: compare#2^#(::(@y, @ys), @x, @xs) -> c_26(compare#3^#(compare(@xs, @ys), @x, @y), compare^#(@xs, @ys)) , 26: compare#2^#(nil(), @x, @xs) -> c_27(#abs^#(#0())) , 27: compare#3^#(@r, @x, @y) -> c_28(compare#4^#(#equal(@r, #0()), @r, @x, @y), #equal^#(@r, #0())) , 28: compare#4^#(#false(), @r, @x, @y) -> c_29() , 29: compare#4^#(#true(), @r, @x, @y) -> c_30(compare#5^#(#less(@x, @y), @x, @y), #less^#(@x, @y)) , 30: compare#5^#(#false(), @x, @y) -> c_31(compare#6^#(#greater(@x, @y)), #greater^#(@x, @y)) , 31: compare#5^#(#true(), @x, @y) -> c_32(-^#(#0(), #pos(#s(#0())))) , 32: compare#6^#(#false()) -> c_33(#abs^#(#0())) , 33: compare#6^#(#true()) -> c_34(#abs^#(#pos(#s(#0())))) , 34: diff^#(@x, @y, @r) -> c_35(mod^#(+(+(@x, @y), @r), #pos(#s(#s(#0())))), +^#(+(@x, @y), @r), +^#(@x, @y), diff#1^#(#less(-(-(@x, @y), @r), #0())), #less^#(-(-(@x, @y), @r), #0()), -^#(-(@x, @y), @r), -^#(@x, @y)) , 35: mod^#(@x, @y) -> c_36(-^#(@x, *(@y, div(@x, @y))), *^#(@y, div(@x, @y)), div^#(@x, @y)) , 36: diff#1^#(#false()) -> c_37(#abs^#(#0())) , 37: diff#1^#(#true()) -> c_38(#abs^#(#pos(#s(#0())))) , 38: div^#(@x, @y) -> c_39(#div^#(@x, @y)) , 39: leq^#(@b1, @b2) -> c_40(#less^#(compare(@b1, @b2), #pos(#s(#0()))), compare^#(@b1, @b2)) , 40: mult^#(@b1, @b2) -> c_41(mult#1^#(@b1, @b2)) , 41: mult#1^#(::(@x, @xs), @b2) -> c_42(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x), #abs^#(#0()), mult^#(@xs, @b2)) , 42: mult#1^#(nil(), @b2) -> c_43() , 43: mult#2^#(@zs, @b2, @x) -> c_44(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs), #equal^#(@x, #pos(#s(#0())))) , 44: mult#3^#(#false(), @b2, @zs) -> c_45() , 45: mult#3^#(#true(), @b2, @zs) -> c_46(add^#(@b2, @zs)) , 46: mult3^#(@b1, @b2, @b3) -> c_47(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2)) , 47: sub^#(@b1, @b2) -> c_48(sub#1^#(sub'(@b1, @b2, #abs(#0()))), sub'^#(@b1, @b2, #abs(#0())), #abs^#(#0())) , 48: sub#1^#(tuple#2(@b, @_@1)) -> c_50() , 49: sub'^#(@b1, @b2, @r) -> c_49(sub'#1^#(@b1, @b2, @r)) , 50: sub'#1^#(::(@x, @xs), @b2, @r) -> c_51(sub'#2^#(@b2, @r, @x, @xs)) , 51: sub'#1^#(nil(), @b2, @r) -> c_52() , 52: sub'#2^#(::(@y, @ys), @r, @x, @xs) -> c_53(sub'#3^#(diff(@x, @y, @r), @xs, @ys), diff^#(@x, @y, @r)) , 53: sub'#2^#(nil(), @r, @x, @xs) -> c_54() , 54: sub'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_55(sub'#4^#(sub'(@xs, @ys, @r'), @z), sub'^#(@xs, @ys, @r')) , 55: sub'#4^#(tuple#2(@zs, @s), @z) -> c_56(sub'#5^#(#equal(@s, #pos(#s(#0()))), @z, @zs), #equal^#(@s, #pos(#s(#0())))) , 56: sub'#5^#(#false(), @z, @zs) -> c_57() , 57: sub'#5^#(#true(), @z, @zs) -> c_58(#abs^#(#0())) , 58: sum#2^#(#false(), @s) -> c_60(sum#3^#(#equal(@s, #pos(#s(#0()))), @s), #equal^#(@s, #pos(#s(#0())))) , 59: sum#2^#(#true(), @s) -> c_61(#abs^#(#0()), #abs^#(#0())) , 60: sum#3^#(#false(), @s) -> c_62(sum#4^#(#equal(@s, #pos(#s(#s(#0()))))), #equal^#(@s, #pos(#s(#s(#0()))))) , 61: sum#3^#(#true(), @s) -> c_63(#abs^#(#pos(#s(#0()))), #abs^#(#0())) , 62: sum#4^#(#false()) -> c_64(#abs^#(#pos(#s(#0()))), #abs^#(#pos(#s(#0())))) , 63: sum#4^#(#true()) -> c_65(#abs^#(#0()), #abs^#(#pos(#s(#0())))) , 64: #eq^#(#0(), #0()) -> c_66() , 65: #eq^#(#0(), #neg(@y)) -> c_67() , 66: #eq^#(#0(), #pos(@y)) -> c_68() , 67: #eq^#(#0(), #s(@y)) -> c_69() , 68: #eq^#(#neg(@x), #0()) -> c_70() , 69: #eq^#(#neg(@x), #neg(@y)) -> c_71(#eq^#(@x, @y)) , 70: #eq^#(#neg(@x), #pos(@y)) -> c_72() , 71: #eq^#(#pos(@x), #0()) -> c_73() , 72: #eq^#(#pos(@x), #neg(@y)) -> c_74() , 73: #eq^#(#pos(@x), #pos(@y)) -> c_75(#eq^#(@x, @y)) , 74: #eq^#(#s(@x), #0()) -> c_76() , 75: #eq^#(#s(@x), #s(@y)) -> c_77(#eq^#(@x, @y)) , 76: #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) -> c_78(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)), #eq^#(@x_1, @y_1), #eq^#(@x_2, @y_2)) , 77: #eq^#(::(@x_1, @x_2), nil()) -> c_79() , 78: #eq^#(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> c_80() , 79: #eq^#(nil(), ::(@y_1, @y_2)) -> c_81() , 80: #eq^#(nil(), nil()) -> c_82() , 81: #eq^#(nil(), tuple#2(@y_1, @y_2)) -> c_83() , 82: #eq^#(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> c_84() , 83: #eq^#(tuple#2(@x_1, @x_2), nil()) -> c_85() , 84: #eq^#(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> c_86(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)), #eq^#(@x_1, @y_1), #eq^#(@x_2, @y_2)) , 85: #ckgt^#(#EQ()) -> c_99() , 86: #ckgt^#(#GT()) -> c_100() , 87: #ckgt^#(#LT()) -> c_101() , 88: #compare^#(#0(), #0()) -> c_87() , 89: #compare^#(#0(), #neg(@y)) -> c_88() , 90: #compare^#(#0(), #pos(@y)) -> c_89() , 91: #compare^#(#0(), #s(@y)) -> c_90() , 92: #compare^#(#neg(@x), #0()) -> c_91() , 93: #compare^#(#neg(@x), #neg(@y)) -> c_92(#compare^#(@y, @x)) , 94: #compare^#(#neg(@x), #pos(@y)) -> c_93() , 95: #compare^#(#pos(@x), #0()) -> c_94() , 96: #compare^#(#pos(@x), #neg(@y)) -> c_95() , 97: #compare^#(#pos(@x), #pos(@y)) -> c_96(#compare^#(@x, @y)) , 98: #compare^#(#s(@x), #0()) -> c_97() , 99: #compare^#(#s(@x), #s(@y)) -> c_98(#compare^#(@x, @y)) , 100: #cklt^#(#EQ()) -> c_102() , 101: #cklt^#(#GT()) -> c_103() , 102: #cklt^#(#LT()) -> c_104() , 103: #mult^#(#0(), #0()) -> c_105() , 104: #mult^#(#0(), #neg(@y)) -> c_106() , 105: #mult^#(#0(), #pos(@y)) -> c_107() , 106: #mult^#(#neg(@x), #0()) -> c_108() , 107: #mult^#(#neg(@x), #neg(@y)) -> c_109(#natmult^#(@x, @y)) , 108: #mult^#(#neg(@x), #pos(@y)) -> c_110(#natmult^#(@x, @y)) , 109: #mult^#(#pos(@x), #0()) -> c_111() , 110: #mult^#(#pos(@x), #neg(@y)) -> c_112(#natmult^#(@x, @y)) , 111: #mult^#(#pos(@x), #pos(@y)) -> c_113(#natmult^#(@x, @y)) , 112: #add^#(#0(), @y) -> c_114() , 113: #add^#(#neg(#s(#0())), @y) -> c_115(#pred^#(@y)) , 114: #add^#(#neg(#s(#s(@x))), @y) -> c_116(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) , 115: #add^#(#pos(#s(#0())), @y) -> c_117(#succ^#(@y)) , 116: #add^#(#pos(#s(#s(@x))), @y) -> c_118(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) , 117: #sub^#(@x, #0()) -> c_119() , 118: #sub^#(@x, #neg(@y)) -> c_120(#add^#(@x, #pos(@y))) , 119: #sub^#(@x, #pos(@y)) -> c_121(#add^#(@x, #neg(@y))) , 120: #div^#(#0(), #0()) -> c_122() , 121: #div^#(#0(), #neg(@y)) -> c_123() , 122: #div^#(#0(), #pos(@y)) -> c_124() , 123: #div^#(#neg(@x), #0()) -> c_125() , 124: #div^#(#neg(@x), #neg(@y)) -> c_126(#positive^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) , 125: #div^#(#neg(@x), #pos(@y)) -> c_127(#negative^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) , 126: #div^#(#pos(@x), #0()) -> c_128() , 127: #div^#(#pos(@x), #neg(@y)) -> c_129(#negative^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) , 128: #div^#(#pos(@x), #pos(@y)) -> c_130(#positive^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) , 129: #and^#(#false(), #false()) -> c_139() , 130: #and^#(#false(), #true()) -> c_140() , 131: #and^#(#true(), #false()) -> c_141() , 132: #and^#(#true(), #true()) -> c_142() , 133: #natmult^#(#0(), @y) -> c_159() , 134: #natmult^#(#s(@x), @y) -> c_160(#natadd^#(@y, #natmult(@x, @y)), #natmult^#(@x, @y)) , 135: #pred^#(#0()) -> c_131() , 136: #pred^#(#neg(#s(@x))) -> c_132() , 137: #pred^#(#pos(#s(#0()))) -> c_133() , 138: #pred^#(#pos(#s(#s(@x)))) -> c_134() , 139: #succ^#(#0()) -> c_135() , 140: #succ^#(#neg(#s(#0()))) -> c_136() , 141: #succ^#(#neg(#s(#s(@x)))) -> c_137() , 142: #succ^#(#pos(#s(@x))) -> c_138() , 143: #positive^#(#0()) -> c_147() , 144: #positive^#(#neg(@x)) -> c_148() , 145: #positive^#(#pos(@x)) -> c_149() , 146: #positive^#(#s(@x)) -> c_150() , 147: #natdiv^#(#0(), #0()) -> c_143() , 148: #natdiv^#(#0(), #s(@y)) -> c_144() , 149: #natdiv^#(#s(@x), #0()) -> c_145() , 150: #natdiv^#(#s(@x), #s(@y)) -> c_146(#natdiv'^#(#divsub(@x, @y), #s(@y)), #divsub^#(@x, @y)) , 151: #negative^#(#0()) -> c_151() , 152: #negative^#(#neg(@x)) -> c_152() , 153: #negative^#(#pos(@x)) -> c_153() , 154: #negative^#(#s(@x)) -> c_154() , 155: #natdiv'^#(#0(), @y) -> c_163() , 156: #natdiv'^#(#s(@x), @y) -> c_164(#natdiv^#(#s(@x), @y)) , 157: #natdiv'^#(#underflow(), @y) -> c_165() , 158: #divsub^#(#0(), #0()) -> c_155() , 159: #divsub^#(#0(), #s(@y)) -> c_156() , 160: #divsub^#(#s(@x), #0()) -> c_157() , 161: #divsub^#(#s(@x), #s(@y)) -> c_158(#divsub^#(@x, @y)) , 162: #natadd^#(#0(), @y) -> c_161() , 163: #natadd^#(#s(@x), @y) -> c_162(#natadd^#(@x, @y)) , 164: #natsub^#(@x, #0()) -> c_166() , 165: #natsub^#(#s(@x), #s(@y)) -> c_167(#natsub^#(@x, @y)) } We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^2)). Strict DPs: { add^#(@b1, @b2) -> c_11(add'^#(@b1, @b2, #abs(#0())), #abs^#(#0())) , add'^#(@b1, @b2, @r) -> c_12(add'#1^#(@b1, @b2, @r)) , add'#1^#(::(@x, @xs), @b2, @r) -> c_13(add'#2^#(@b2, @r, @x, @xs)) , add'#2^#(::(@y, @ys), @r, @x, @xs) -> c_15(add'#3^#(sum(@x, @y, @r), @xs, @ys), sum^#(@x, @y, @r)) , add'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_18(add'^#(@xs, @ys, @r')) , sum^#(@x, @y, @r) -> c_17(sum#1^#(+(+(@x, @y), @r)), +^#(+(@x, @y), @r), +^#(@x, @y)) , sum#1^#(@s) -> c_59(sum#2^#(#equal(@s, #0()), @s), #equal^#(@s, #0())) , bitToInt^#(@b) -> c_19(bitToInt'^#(@b, #abs(#pos(#s(#0())))), #abs^#(#pos(#s(#0())))) , bitToInt'^#(@b, @n) -> c_20(bitToInt'#1^#(@b, @n)) , bitToInt'#1^#(::(@x, @xs), @n) -> c_21(+^#(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))), *^#(@x, @n), bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))), *^#(@n, #pos(#s(#s(#0()))))) , bitToInt'#1^#(nil(), @n) -> c_22(#abs^#(#0())) , compare^#(@b1, @b2) -> c_23(compare#1^#(@b1, @b2)) , compare#1^#(::(@x, @xs), @b2) -> c_24(compare#2^#(@b2, @x, @xs)) , compare#1^#(nil(), @b2) -> c_25(#abs^#(#0())) , compare#2^#(::(@y, @ys), @x, @xs) -> c_26(compare#3^#(compare(@xs, @ys), @x, @y), compare^#(@xs, @ys)) , compare#2^#(nil(), @x, @xs) -> c_27(#abs^#(#0())) , compare#3^#(@r, @x, @y) -> c_28(compare#4^#(#equal(@r, #0()), @r, @x, @y), #equal^#(@r, #0())) , compare#4^#(#true(), @r, @x, @y) -> c_30(compare#5^#(#less(@x, @y), @x, @y), #less^#(@x, @y)) , compare#5^#(#false(), @x, @y) -> c_31(compare#6^#(#greater(@x, @y)), #greater^#(@x, @y)) , compare#5^#(#true(), @x, @y) -> c_32(-^#(#0(), #pos(#s(#0())))) , compare#6^#(#false()) -> c_33(#abs^#(#0())) , compare#6^#(#true()) -> c_34(#abs^#(#pos(#s(#0())))) , diff^#(@x, @y, @r) -> c_35(mod^#(+(+(@x, @y), @r), #pos(#s(#s(#0())))), +^#(+(@x, @y), @r), +^#(@x, @y), diff#1^#(#less(-(-(@x, @y), @r), #0())), #less^#(-(-(@x, @y), @r), #0()), -^#(-(@x, @y), @r), -^#(@x, @y)) , mod^#(@x, @y) -> c_36(-^#(@x, *(@y, div(@x, @y))), *^#(@y, div(@x, @y)), div^#(@x, @y)) , diff#1^#(#false()) -> c_37(#abs^#(#0())) , diff#1^#(#true()) -> c_38(#abs^#(#pos(#s(#0())))) , leq^#(@b1, @b2) -> c_40(#less^#(compare(@b1, @b2), #pos(#s(#0()))), compare^#(@b1, @b2)) , mult^#(@b1, @b2) -> c_41(mult#1^#(@b1, @b2)) , mult#1^#(::(@x, @xs), @b2) -> c_42(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x), #abs^#(#0()), mult^#(@xs, @b2)) , mult#2^#(@zs, @b2, @x) -> c_44(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs), #equal^#(@x, #pos(#s(#0())))) , mult#3^#(#true(), @b2, @zs) -> c_46(add^#(@b2, @zs)) , mult3^#(@b1, @b2, @b3) -> c_47(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2)) , sub^#(@b1, @b2) -> c_48(sub#1^#(sub'(@b1, @b2, #abs(#0()))), sub'^#(@b1, @b2, #abs(#0())), #abs^#(#0())) , sub'^#(@b1, @b2, @r) -> c_49(sub'#1^#(@b1, @b2, @r)) , sub'#1^#(::(@x, @xs), @b2, @r) -> c_51(sub'#2^#(@b2, @r, @x, @xs)) , sub'#2^#(::(@y, @ys), @r, @x, @xs) -> c_53(sub'#3^#(diff(@x, @y, @r), @xs, @ys), diff^#(@x, @y, @r)) , sub'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_55(sub'#4^#(sub'(@xs, @ys, @r'), @z), sub'^#(@xs, @ys, @r')) , sub'#4^#(tuple#2(@zs, @s), @z) -> c_56(sub'#5^#(#equal(@s, #pos(#s(#0()))), @z, @zs), #equal^#(@s, #pos(#s(#0())))) , sub'#5^#(#true(), @z, @zs) -> c_58(#abs^#(#0())) , sum#2^#(#false(), @s) -> c_60(sum#3^#(#equal(@s, #pos(#s(#0()))), @s), #equal^#(@s, #pos(#s(#0())))) , sum#2^#(#true(), @s) -> c_61(#abs^#(#0()), #abs^#(#0())) , sum#3^#(#false(), @s) -> c_62(sum#4^#(#equal(@s, #pos(#s(#s(#0()))))), #equal^#(@s, #pos(#s(#s(#0()))))) , sum#3^#(#true(), @s) -> c_63(#abs^#(#pos(#s(#0()))), #abs^#(#0())) , sum#4^#(#false()) -> c_64(#abs^#(#pos(#s(#0()))), #abs^#(#pos(#s(#0())))) , sum#4^#(#true()) -> c_65(#abs^#(#0()), #abs^#(#pos(#s(#0())))) } Weak DPs: { #abs^#(#0()) -> c_1() , #abs^#(#pos(@x)) -> c_3() , #equal^#(@x, @y) -> c_5(#eq^#(@x, @y)) , #eq^#(#0(), #0()) -> c_66() , #eq^#(#0(), #neg(@y)) -> c_67() , #eq^#(#0(), #pos(@y)) -> c_68() , #eq^#(#0(), #s(@y)) -> c_69() , #eq^#(#neg(@x), #0()) -> c_70() , #eq^#(#neg(@x), #neg(@y)) -> c_71(#eq^#(@x, @y)) , #eq^#(#neg(@x), #pos(@y)) -> c_72() , #eq^#(#pos(@x), #0()) -> c_73() , #eq^#(#pos(@x), #neg(@y)) -> c_74() , #eq^#(#pos(@x), #pos(@y)) -> c_75(#eq^#(@x, @y)) , #eq^#(#s(@x), #0()) -> c_76() , #eq^#(#s(@x), #s(@y)) -> c_77(#eq^#(@x, @y)) , #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) -> c_78(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)), #eq^#(@x_1, @y_1), #eq^#(@x_2, @y_2)) , #eq^#(::(@x_1, @x_2), nil()) -> c_79() , #eq^#(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> c_80() , #eq^#(nil(), ::(@y_1, @y_2)) -> c_81() , #eq^#(nil(), nil()) -> c_82() , #eq^#(nil(), tuple#2(@y_1, @y_2)) -> c_83() , #eq^#(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> c_84() , #eq^#(tuple#2(@x_1, @x_2), nil()) -> c_85() , #eq^#(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> c_86(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)), #eq^#(@x_1, @y_1), #eq^#(@x_2, @y_2)) , #greater^#(@x, @y) -> c_6(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y)) , #ckgt^#(#EQ()) -> c_99() , #ckgt^#(#GT()) -> c_100() , #ckgt^#(#LT()) -> c_101() , #compare^#(#0(), #0()) -> c_87() , #compare^#(#0(), #neg(@y)) -> c_88() , #compare^#(#0(), #pos(@y)) -> c_89() , #compare^#(#0(), #s(@y)) -> c_90() , #compare^#(#neg(@x), #0()) -> c_91() , #compare^#(#neg(@x), #neg(@y)) -> c_92(#compare^#(@y, @x)) , #compare^#(#neg(@x), #pos(@y)) -> c_93() , #compare^#(#pos(@x), #0()) -> c_94() , #compare^#(#pos(@x), #neg(@y)) -> c_95() , #compare^#(#pos(@x), #pos(@y)) -> c_96(#compare^#(@x, @y)) , #compare^#(#s(@x), #0()) -> c_97() , #compare^#(#s(@x), #s(@y)) -> c_98(#compare^#(@x, @y)) , #less^#(@x, @y) -> c_7(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y)) , #cklt^#(#EQ()) -> c_102() , #cklt^#(#GT()) -> c_103() , #cklt^#(#LT()) -> c_104() , *^#(@x, @y) -> c_8(#mult^#(@x, @y)) , #mult^#(#0(), #0()) -> c_105() , #mult^#(#0(), #neg(@y)) -> c_106() , #mult^#(#0(), #pos(@y)) -> c_107() , #mult^#(#neg(@x), #0()) -> c_108() , #mult^#(#neg(@x), #neg(@y)) -> c_109(#natmult^#(@x, @y)) , #mult^#(#neg(@x), #pos(@y)) -> c_110(#natmult^#(@x, @y)) , #mult^#(#pos(@x), #0()) -> c_111() , #mult^#(#pos(@x), #neg(@y)) -> c_112(#natmult^#(@x, @y)) , #mult^#(#pos(@x), #pos(@y)) -> c_113(#natmult^#(@x, @y)) , +^#(@x, @y) -> c_9(#add^#(@x, @y)) , #add^#(#0(), @y) -> c_114() , #add^#(#neg(#s(#0())), @y) -> c_115(#pred^#(@y)) , #add^#(#neg(#s(#s(@x))), @y) -> c_116(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) , #add^#(#pos(#s(#0())), @y) -> c_117(#succ^#(@y)) , #add^#(#pos(#s(#s(@x))), @y) -> c_118(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) , -^#(@x, @y) -> c_10(#sub^#(@x, @y)) , #sub^#(@x, #0()) -> c_119() , #sub^#(@x, #neg(@y)) -> c_120(#add^#(@x, #pos(@y))) , #sub^#(@x, #pos(@y)) -> c_121(#add^#(@x, #neg(@y))) , add'#1^#(nil(), @b2, @r) -> c_14() , add'#2^#(nil(), @r, @x, @xs) -> c_16() , compare#4^#(#false(), @r, @x, @y) -> c_29() , div^#(@x, @y) -> c_39(#div^#(@x, @y)) , #div^#(#0(), #0()) -> c_122() , #div^#(#0(), #neg(@y)) -> c_123() , #div^#(#0(), #pos(@y)) -> c_124() , #div^#(#neg(@x), #0()) -> c_125() , #div^#(#neg(@x), #neg(@y)) -> c_126(#positive^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) , #div^#(#neg(@x), #pos(@y)) -> c_127(#negative^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) , #div^#(#pos(@x), #0()) -> c_128() , #div^#(#pos(@x), #neg(@y)) -> c_129(#negative^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) , #div^#(#pos(@x), #pos(@y)) -> c_130(#positive^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) , mult#1^#(nil(), @b2) -> c_43() , mult#3^#(#false(), @b2, @zs) -> c_45() , sub#1^#(tuple#2(@b, @_@1)) -> c_50() , sub'#1^#(nil(), @b2, @r) -> c_52() , sub'#2^#(nil(), @r, @x, @xs) -> c_54() , sub'#5^#(#false(), @z, @zs) -> c_57() , #and^#(#false(), #false()) -> c_139() , #and^#(#false(), #true()) -> c_140() , #and^#(#true(), #false()) -> c_141() , #and^#(#true(), #true()) -> c_142() , #natmult^#(#0(), @y) -> c_159() , #natmult^#(#s(@x), @y) -> c_160(#natadd^#(@y, #natmult(@x, @y)), #natmult^#(@x, @y)) , #pred^#(#0()) -> c_131() , #pred^#(#neg(#s(@x))) -> c_132() , #pred^#(#pos(#s(#0()))) -> c_133() , #pred^#(#pos(#s(#s(@x)))) -> c_134() , #succ^#(#0()) -> c_135() , #succ^#(#neg(#s(#0()))) -> c_136() , #succ^#(#neg(#s(#s(@x)))) -> c_137() , #succ^#(#pos(#s(@x))) -> c_138() , #positive^#(#0()) -> c_147() , #positive^#(#neg(@x)) -> c_148() , #positive^#(#pos(@x)) -> c_149() , #positive^#(#s(@x)) -> c_150() , #natdiv^#(#0(), #0()) -> c_143() , #natdiv^#(#0(), #s(@y)) -> c_144() , #natdiv^#(#s(@x), #0()) -> c_145() , #natdiv^#(#s(@x), #s(@y)) -> c_146(#natdiv'^#(#divsub(@x, @y), #s(@y)), #divsub^#(@x, @y)) , #negative^#(#0()) -> c_151() , #negative^#(#neg(@x)) -> c_152() , #negative^#(#pos(@x)) -> c_153() , #negative^#(#s(@x)) -> c_154() , #natdiv'^#(#0(), @y) -> c_163() , #natdiv'^#(#s(@x), @y) -> c_164(#natdiv^#(#s(@x), @y)) , #natdiv'^#(#underflow(), @y) -> c_165() , #divsub^#(#0(), #0()) -> c_155() , #divsub^#(#0(), #s(@y)) -> c_156() , #divsub^#(#s(@x), #0()) -> c_157() , #divsub^#(#s(@x), #s(@y)) -> c_158(#divsub^#(@x, @y)) , #natadd^#(#0(), @y) -> c_161() , #natadd^#(#s(@x), @y) -> c_162(#natadd^#(@x, @y)) , #natsub^#(@x, #0()) -> c_166() , #natsub^#(#s(@x), #s(@y)) -> c_167(#natsub^#(@x, @y)) } Weak Trs: { #abs(#0()) -> #0() , #abs(#neg(@x)) -> #pos(@x) , #abs(#pos(@x)) -> #pos(@x) , #abs(#s(@x)) -> #pos(#s(@x)) , #equal(@x, @y) -> #eq(@x, @y) , #eq(#0(), #0()) -> #true() , #eq(#0(), #neg(@y)) -> #false() , #eq(#0(), #pos(@y)) -> #false() , #eq(#0(), #s(@y)) -> #false() , #eq(#neg(@x), #0()) -> #false() , #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #pos(@y)) -> #false() , #eq(#pos(@x), #0()) -> #false() , #eq(#pos(@x), #neg(@y)) -> #false() , #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y) , #eq(#s(@x), #0()) -> #false() , #eq(#s(@x), #s(@y)) -> #eq(@x, @y) , #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #eq(::(@x_1, @x_2), nil()) -> #false() , #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false() , #eq(nil(), ::(@y_1, @y_2)) -> #false() , #eq(nil(), nil()) -> #true() , #eq(nil(), tuple#2(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), nil()) -> #false() , #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #greater(@x, @y) -> #ckgt(#compare(@x, @y)) , #compare(#0(), #0()) -> #EQ() , #compare(#0(), #neg(@y)) -> #GT() , #compare(#0(), #pos(@y)) -> #LT() , #compare(#0(), #s(@y)) -> #LT() , #compare(#neg(@x), #0()) -> #LT() , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x) , #compare(#neg(@x), #pos(@y)) -> #LT() , #compare(#pos(@x), #0()) -> #GT() , #compare(#pos(@x), #neg(@y)) -> #GT() , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y) , #compare(#s(@x), #0()) -> #GT() , #compare(#s(@x), #s(@y)) -> #compare(@x, @y) , #ckgt(#EQ()) -> #false() , #ckgt(#GT()) -> #true() , #ckgt(#LT()) -> #false() , #less(@x, @y) -> #cklt(#compare(@x, @y)) , #cklt(#EQ()) -> #false() , #cklt(#GT()) -> #false() , #cklt(#LT()) -> #true() , *(@x, @y) -> #mult(@x, @y) , #mult(#0(), #0()) -> #0() , #mult(#0(), #neg(@y)) -> #0() , #mult(#0(), #pos(@y)) -> #0() , #mult(#neg(@x), #0()) -> #0() , #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y)) , #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #0()) -> #0() , #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y)) , +(@x, @y) -> #add(@x, @y) , #add(#0(), @y) -> @y , #add(#neg(#s(#0())), @y) -> #pred(@y) , #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y)) , #add(#pos(#s(#0())), @y) -> #succ(@y) , #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y)) , -(@x, @y) -> #sub(@x, @y) , #sub(@x, #0()) -> @x , #sub(@x, #neg(@y)) -> #add(@x, #pos(@y)) , #sub(@x, #pos(@y)) -> #add(@x, #neg(@y)) , add(@b1, @b2) -> add'(@b1, @b2, #abs(#0())) , add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r) , add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs) , add'#1(nil(), @b2, @r) -> nil() , add'#2(::(@y, @ys), @r, @x, @xs) -> add'#3(sum(@x, @y, @r), @xs, @ys) , add'#2(nil(), @r, @x, @xs) -> nil() , sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r)) , add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r')) , bitToInt(@b) -> bitToInt'(@b, #abs(#pos(#s(#0())))) , bitToInt'(@b, @n) -> bitToInt'#1(@b, @n) , bitToInt'#1(::(@x, @xs), @n) -> +(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))) , bitToInt'#1(nil(), @n) -> #abs(#0()) , compare(@b1, @b2) -> compare#1(@b1, @b2) , compare#1(::(@x, @xs), @b2) -> compare#2(@b2, @x, @xs) , compare#1(nil(), @b2) -> #abs(#0()) , compare#2(::(@y, @ys), @x, @xs) -> compare#3(compare(@xs, @ys), @x, @y) , compare#2(nil(), @x, @xs) -> #abs(#0()) , compare#3(@r, @x, @y) -> compare#4(#equal(@r, #0()), @r, @x, @y) , compare#4(#false(), @r, @x, @y) -> @r , compare#4(#true(), @r, @x, @y) -> compare#5(#less(@x, @y), @x, @y) , compare#5(#false(), @x, @y) -> compare#6(#greater(@x, @y)) , compare#5(#true(), @x, @y) -> -(#0(), #pos(#s(#0()))) , compare#6(#false()) -> #abs(#0()) , compare#6(#true()) -> #abs(#pos(#s(#0()))) , diff(@x, @y, @r) -> tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))), diff#1(#less(-(-(@x, @y), @r), #0()))) , mod(@x, @y) -> -(@x, *(@y, div(@x, @y))) , diff#1(#false()) -> #abs(#0()) , diff#1(#true()) -> #abs(#pos(#s(#0()))) , div(@x, @y) -> #div(@x, @y) , #div(#0(), #0()) -> #divByZero() , #div(#0(), #neg(@y)) -> #0() , #div(#0(), #pos(@y)) -> #0() , #div(#neg(@x), #0()) -> #divByZero() , #div(#neg(@x), #neg(@y)) -> #positive(#natdiv(@x, @y)) , #div(#neg(@x), #pos(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #0()) -> #divByZero() , #div(#pos(@x), #neg(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #pos(@y)) -> #positive(#natdiv(@x, @y)) , leq(@b1, @b2) -> #less(compare(@b1, @b2), #pos(#s(#0()))) , mult(@b1, @b2) -> mult#1(@b1, @b2) , mult#1(::(@x, @xs), @b2) -> mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x) , mult#1(nil(), @b2) -> nil() , mult#2(@zs, @b2, @x) -> mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs) , mult#3(#false(), @b2, @zs) -> @zs , mult#3(#true(), @b2, @zs) -> add(@b2, @zs) , mult3(@b1, @b2, @b3) -> mult(mult(@b1, @b2), @b2) , sub(@b1, @b2) -> sub#1(sub'(@b1, @b2, #abs(#0()))) , sub'(@b1, @b2, @r) -> sub'#1(@b1, @b2, @r) , sub#1(tuple#2(@b, @_@1)) -> @b , sub'#1(::(@x, @xs), @b2, @r) -> sub'#2(@b2, @r, @x, @xs) , sub'#1(nil(), @b2, @r) -> tuple#2(nil(), @r) , sub'#2(::(@y, @ys), @r, @x, @xs) -> sub'#3(diff(@x, @y, @r), @xs, @ys) , sub'#2(nil(), @r, @x, @xs) -> tuple#2(nil(), @r) , sub'#3(tuple#2(@z, @r'), @xs, @ys) -> sub'#4(sub'(@xs, @ys, @r'), @z) , sub'#4(tuple#2(@zs, @s), @z) -> tuple#2(sub'#5(#equal(@s, #pos(#s(#0()))), @z, @zs), @s) , sub'#5(#false(), @z, @zs) -> ::(@z, @zs) , sub'#5(#true(), @z, @zs) -> ::(#abs(#0()), @zs) , sum#1(@s) -> sum#2(#equal(@s, #0()), @s) , sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s) , sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0())) , sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0()))))) , sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0())) , sum#4(#false()) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0())))) , sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0())))) , #pred(#0()) -> #neg(#s(#0())) , #pred(#neg(#s(@x))) -> #neg(#s(#s(@x))) , #pred(#pos(#s(#0()))) -> #0() , #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x)) , #succ(#0()) -> #pos(#s(#0())) , #succ(#neg(#s(#0()))) -> #0() , #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x)) , #succ(#pos(#s(@x))) -> #pos(#s(#s(@x))) , #and(#false(), #false()) -> #false() , #and(#false(), #true()) -> #false() , #and(#true(), #false()) -> #false() , #and(#true(), #true()) -> #true() , #natdiv(#0(), #0()) -> #divByZero() , #natdiv(#0(), #s(@y)) -> #0() , #natdiv(#s(@x), #0()) -> #divByZero() , #natdiv(#s(@x), #s(@y)) -> #natdiv'(#divsub(@x, @y), #s(@y)) , #positive(#0()) -> #0() , #positive(#neg(@x)) -> #neg(@x) , #positive(#pos(@x)) -> #pos(@x) , #positive(#s(@x)) -> #pos(#s(@x)) , #negative(#0()) -> #0() , #negative(#neg(@x)) -> #pos(@x) , #negative(#pos(@x)) -> #neg(@x) , #negative(#s(@x)) -> #neg(#s(@x)) , #divsub(#0(), #0()) -> #0() , #divsub(#0(), #s(@y)) -> #underflow() , #divsub(#s(@x), #0()) -> #s(@x) , #divsub(#s(@x), #s(@y)) -> #divsub(@x, @y) , #natmult(#0(), @y) -> #0() , #natmult(#s(@x), @y) -> #natadd(@y, #natmult(@x, @y)) , #natadd(#0(), @y) -> @y , #natadd(#s(@x), @y) -> #s(#natadd(@x, @y)) , #natdiv'(#0(), @y) -> #s(#0()) , #natdiv'(#s(@x), @y) -> #s(#natdiv(#s(@x), @y)) , #natdiv'(#underflow(), @y) -> #0() , #natsub(@x, #0()) -> @x , #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^2)) We estimate the number of application of {11,14,16,20,21,22,24,25,26,39,41,43,44,45} by applications of Pre({11,14,16,20,21,22,24,25,26,39,41,43,44,45}) = {7,9,12,13,18,19,23,38,40,42}. Here rules are labeled as follows: DPs: { 1: add^#(@b1, @b2) -> c_11(add'^#(@b1, @b2, #abs(#0())), #abs^#(#0())) , 2: add'^#(@b1, @b2, @r) -> c_12(add'#1^#(@b1, @b2, @r)) , 3: add'#1^#(::(@x, @xs), @b2, @r) -> c_13(add'#2^#(@b2, @r, @x, @xs)) , 4: add'#2^#(::(@y, @ys), @r, @x, @xs) -> c_15(add'#3^#(sum(@x, @y, @r), @xs, @ys), sum^#(@x, @y, @r)) , 5: add'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_18(add'^#(@xs, @ys, @r')) , 6: sum^#(@x, @y, @r) -> c_17(sum#1^#(+(+(@x, @y), @r)), +^#(+(@x, @y), @r), +^#(@x, @y)) , 7: sum#1^#(@s) -> c_59(sum#2^#(#equal(@s, #0()), @s), #equal^#(@s, #0())) , 8: bitToInt^#(@b) -> c_19(bitToInt'^#(@b, #abs(#pos(#s(#0())))), #abs^#(#pos(#s(#0())))) , 9: bitToInt'^#(@b, @n) -> c_20(bitToInt'#1^#(@b, @n)) , 10: bitToInt'#1^#(::(@x, @xs), @n) -> c_21(+^#(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))), *^#(@x, @n), bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))), *^#(@n, #pos(#s(#s(#0()))))) , 11: bitToInt'#1^#(nil(), @n) -> c_22(#abs^#(#0())) , 12: compare^#(@b1, @b2) -> c_23(compare#1^#(@b1, @b2)) , 13: compare#1^#(::(@x, @xs), @b2) -> c_24(compare#2^#(@b2, @x, @xs)) , 14: compare#1^#(nil(), @b2) -> c_25(#abs^#(#0())) , 15: compare#2^#(::(@y, @ys), @x, @xs) -> c_26(compare#3^#(compare(@xs, @ys), @x, @y), compare^#(@xs, @ys)) , 16: compare#2^#(nil(), @x, @xs) -> c_27(#abs^#(#0())) , 17: compare#3^#(@r, @x, @y) -> c_28(compare#4^#(#equal(@r, #0()), @r, @x, @y), #equal^#(@r, #0())) , 18: compare#4^#(#true(), @r, @x, @y) -> c_30(compare#5^#(#less(@x, @y), @x, @y), #less^#(@x, @y)) , 19: compare#5^#(#false(), @x, @y) -> c_31(compare#6^#(#greater(@x, @y)), #greater^#(@x, @y)) , 20: compare#5^#(#true(), @x, @y) -> c_32(-^#(#0(), #pos(#s(#0())))) , 21: compare#6^#(#false()) -> c_33(#abs^#(#0())) , 22: compare#6^#(#true()) -> c_34(#abs^#(#pos(#s(#0())))) , 23: diff^#(@x, @y, @r) -> c_35(mod^#(+(+(@x, @y), @r), #pos(#s(#s(#0())))), +^#(+(@x, @y), @r), +^#(@x, @y), diff#1^#(#less(-(-(@x, @y), @r), #0())), #less^#(-(-(@x, @y), @r), #0()), -^#(-(@x, @y), @r), -^#(@x, @y)) , 24: mod^#(@x, @y) -> c_36(-^#(@x, *(@y, div(@x, @y))), *^#(@y, div(@x, @y)), div^#(@x, @y)) , 25: diff#1^#(#false()) -> c_37(#abs^#(#0())) , 26: diff#1^#(#true()) -> c_38(#abs^#(#pos(#s(#0())))) , 27: leq^#(@b1, @b2) -> c_40(#less^#(compare(@b1, @b2), #pos(#s(#0()))), compare^#(@b1, @b2)) , 28: mult^#(@b1, @b2) -> c_41(mult#1^#(@b1, @b2)) , 29: mult#1^#(::(@x, @xs), @b2) -> c_42(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x), #abs^#(#0()), mult^#(@xs, @b2)) , 30: mult#2^#(@zs, @b2, @x) -> c_44(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs), #equal^#(@x, #pos(#s(#0())))) , 31: mult#3^#(#true(), @b2, @zs) -> c_46(add^#(@b2, @zs)) , 32: mult3^#(@b1, @b2, @b3) -> c_47(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2)) , 33: sub^#(@b1, @b2) -> c_48(sub#1^#(sub'(@b1, @b2, #abs(#0()))), sub'^#(@b1, @b2, #abs(#0())), #abs^#(#0())) , 34: sub'^#(@b1, @b2, @r) -> c_49(sub'#1^#(@b1, @b2, @r)) , 35: sub'#1^#(::(@x, @xs), @b2, @r) -> c_51(sub'#2^#(@b2, @r, @x, @xs)) , 36: sub'#2^#(::(@y, @ys), @r, @x, @xs) -> c_53(sub'#3^#(diff(@x, @y, @r), @xs, @ys), diff^#(@x, @y, @r)) , 37: sub'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_55(sub'#4^#(sub'(@xs, @ys, @r'), @z), sub'^#(@xs, @ys, @r')) , 38: sub'#4^#(tuple#2(@zs, @s), @z) -> c_56(sub'#5^#(#equal(@s, #pos(#s(#0()))), @z, @zs), #equal^#(@s, #pos(#s(#0())))) , 39: sub'#5^#(#true(), @z, @zs) -> c_58(#abs^#(#0())) , 40: sum#2^#(#false(), @s) -> c_60(sum#3^#(#equal(@s, #pos(#s(#0()))), @s), #equal^#(@s, #pos(#s(#0())))) , 41: sum#2^#(#true(), @s) -> c_61(#abs^#(#0()), #abs^#(#0())) , 42: sum#3^#(#false(), @s) -> c_62(sum#4^#(#equal(@s, #pos(#s(#s(#0()))))), #equal^#(@s, #pos(#s(#s(#0()))))) , 43: sum#3^#(#true(), @s) -> c_63(#abs^#(#pos(#s(#0()))), #abs^#(#0())) , 44: sum#4^#(#false()) -> c_64(#abs^#(#pos(#s(#0()))), #abs^#(#pos(#s(#0())))) , 45: sum#4^#(#true()) -> c_65(#abs^#(#0()), #abs^#(#pos(#s(#0())))) , 46: #abs^#(#0()) -> c_1() , 47: #abs^#(#pos(@x)) -> c_3() , 48: #equal^#(@x, @y) -> c_5(#eq^#(@x, @y)) , 49: #eq^#(#0(), #0()) -> c_66() , 50: #eq^#(#0(), #neg(@y)) -> c_67() , 51: #eq^#(#0(), #pos(@y)) -> c_68() , 52: #eq^#(#0(), #s(@y)) -> c_69() , 53: #eq^#(#neg(@x), #0()) -> c_70() , 54: #eq^#(#neg(@x), #neg(@y)) -> c_71(#eq^#(@x, @y)) , 55: #eq^#(#neg(@x), #pos(@y)) -> c_72() , 56: #eq^#(#pos(@x), #0()) -> c_73() , 57: #eq^#(#pos(@x), #neg(@y)) -> c_74() , 58: #eq^#(#pos(@x), #pos(@y)) -> c_75(#eq^#(@x, @y)) , 59: #eq^#(#s(@x), #0()) -> c_76() , 60: #eq^#(#s(@x), #s(@y)) -> c_77(#eq^#(@x, @y)) , 61: #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) -> c_78(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)), #eq^#(@x_1, @y_1), #eq^#(@x_2, @y_2)) , 62: #eq^#(::(@x_1, @x_2), nil()) -> c_79() , 63: #eq^#(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> c_80() , 64: #eq^#(nil(), ::(@y_1, @y_2)) -> c_81() , 65: #eq^#(nil(), nil()) -> c_82() , 66: #eq^#(nil(), tuple#2(@y_1, @y_2)) -> c_83() , 67: #eq^#(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> c_84() , 68: #eq^#(tuple#2(@x_1, @x_2), nil()) -> c_85() , 69: #eq^#(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> c_86(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)), #eq^#(@x_1, @y_1), #eq^#(@x_2, @y_2)) , 70: #greater^#(@x, @y) -> c_6(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y)) , 71: #ckgt^#(#EQ()) -> c_99() , 72: #ckgt^#(#GT()) -> c_100() , 73: #ckgt^#(#LT()) -> c_101() , 74: #compare^#(#0(), #0()) -> c_87() , 75: #compare^#(#0(), #neg(@y)) -> c_88() , 76: #compare^#(#0(), #pos(@y)) -> c_89() , 77: #compare^#(#0(), #s(@y)) -> c_90() , 78: #compare^#(#neg(@x), #0()) -> c_91() , 79: #compare^#(#neg(@x), #neg(@y)) -> c_92(#compare^#(@y, @x)) , 80: #compare^#(#neg(@x), #pos(@y)) -> c_93() , 81: #compare^#(#pos(@x), #0()) -> c_94() , 82: #compare^#(#pos(@x), #neg(@y)) -> c_95() , 83: #compare^#(#pos(@x), #pos(@y)) -> c_96(#compare^#(@x, @y)) , 84: #compare^#(#s(@x), #0()) -> c_97() , 85: #compare^#(#s(@x), #s(@y)) -> c_98(#compare^#(@x, @y)) , 86: #less^#(@x, @y) -> c_7(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y)) , 87: #cklt^#(#EQ()) -> c_102() , 88: #cklt^#(#GT()) -> c_103() , 89: #cklt^#(#LT()) -> c_104() , 90: *^#(@x, @y) -> c_8(#mult^#(@x, @y)) , 91: #mult^#(#0(), #0()) -> c_105() , 92: #mult^#(#0(), #neg(@y)) -> c_106() , 93: #mult^#(#0(), #pos(@y)) -> c_107() , 94: #mult^#(#neg(@x), #0()) -> c_108() , 95: #mult^#(#neg(@x), #neg(@y)) -> c_109(#natmult^#(@x, @y)) , 96: #mult^#(#neg(@x), #pos(@y)) -> c_110(#natmult^#(@x, @y)) , 97: #mult^#(#pos(@x), #0()) -> c_111() , 98: #mult^#(#pos(@x), #neg(@y)) -> c_112(#natmult^#(@x, @y)) , 99: #mult^#(#pos(@x), #pos(@y)) -> c_113(#natmult^#(@x, @y)) , 100: +^#(@x, @y) -> c_9(#add^#(@x, @y)) , 101: #add^#(#0(), @y) -> c_114() , 102: #add^#(#neg(#s(#0())), @y) -> c_115(#pred^#(@y)) , 103: #add^#(#neg(#s(#s(@x))), @y) -> c_116(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) , 104: #add^#(#pos(#s(#0())), @y) -> c_117(#succ^#(@y)) , 105: #add^#(#pos(#s(#s(@x))), @y) -> c_118(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) , 106: -^#(@x, @y) -> c_10(#sub^#(@x, @y)) , 107: #sub^#(@x, #0()) -> c_119() , 108: #sub^#(@x, #neg(@y)) -> c_120(#add^#(@x, #pos(@y))) , 109: #sub^#(@x, #pos(@y)) -> c_121(#add^#(@x, #neg(@y))) , 110: add'#1^#(nil(), @b2, @r) -> c_14() , 111: add'#2^#(nil(), @r, @x, @xs) -> c_16() , 112: compare#4^#(#false(), @r, @x, @y) -> c_29() , 113: div^#(@x, @y) -> c_39(#div^#(@x, @y)) , 114: #div^#(#0(), #0()) -> c_122() , 115: #div^#(#0(), #neg(@y)) -> c_123() , 116: #div^#(#0(), #pos(@y)) -> c_124() , 117: #div^#(#neg(@x), #0()) -> c_125() , 118: #div^#(#neg(@x), #neg(@y)) -> c_126(#positive^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) , 119: #div^#(#neg(@x), #pos(@y)) -> c_127(#negative^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) , 120: #div^#(#pos(@x), #0()) -> c_128() , 121: #div^#(#pos(@x), #neg(@y)) -> c_129(#negative^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) , 122: #div^#(#pos(@x), #pos(@y)) -> c_130(#positive^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) , 123: mult#1^#(nil(), @b2) -> c_43() , 124: mult#3^#(#false(), @b2, @zs) -> c_45() , 125: sub#1^#(tuple#2(@b, @_@1)) -> c_50() , 126: sub'#1^#(nil(), @b2, @r) -> c_52() , 127: sub'#2^#(nil(), @r, @x, @xs) -> c_54() , 128: sub'#5^#(#false(), @z, @zs) -> c_57() , 129: #and^#(#false(), #false()) -> c_139() , 130: #and^#(#false(), #true()) -> c_140() , 131: #and^#(#true(), #false()) -> c_141() , 132: #and^#(#true(), #true()) -> c_142() , 133: #natmult^#(#0(), @y) -> c_159() , 134: #natmult^#(#s(@x), @y) -> c_160(#natadd^#(@y, #natmult(@x, @y)), #natmult^#(@x, @y)) , 135: #pred^#(#0()) -> c_131() , 136: #pred^#(#neg(#s(@x))) -> c_132() , 137: #pred^#(#pos(#s(#0()))) -> c_133() , 138: #pred^#(#pos(#s(#s(@x)))) -> c_134() , 139: #succ^#(#0()) -> c_135() , 140: #succ^#(#neg(#s(#0()))) -> c_136() , 141: #succ^#(#neg(#s(#s(@x)))) -> c_137() , 142: #succ^#(#pos(#s(@x))) -> c_138() , 143: #positive^#(#0()) -> c_147() , 144: #positive^#(#neg(@x)) -> c_148() , 145: #positive^#(#pos(@x)) -> c_149() , 146: #positive^#(#s(@x)) -> c_150() , 147: #natdiv^#(#0(), #0()) -> c_143() , 148: #natdiv^#(#0(), #s(@y)) -> c_144() , 149: #natdiv^#(#s(@x), #0()) -> c_145() , 150: #natdiv^#(#s(@x), #s(@y)) -> c_146(#natdiv'^#(#divsub(@x, @y), #s(@y)), #divsub^#(@x, @y)) , 151: #negative^#(#0()) -> c_151() , 152: #negative^#(#neg(@x)) -> c_152() , 153: #negative^#(#pos(@x)) -> c_153() , 154: #negative^#(#s(@x)) -> c_154() , 155: #natdiv'^#(#0(), @y) -> c_163() , 156: #natdiv'^#(#s(@x), @y) -> c_164(#natdiv^#(#s(@x), @y)) , 157: #natdiv'^#(#underflow(), @y) -> c_165() , 158: #divsub^#(#0(), #0()) -> c_155() , 159: #divsub^#(#0(), #s(@y)) -> c_156() , 160: #divsub^#(#s(@x), #0()) -> c_157() , 161: #divsub^#(#s(@x), #s(@y)) -> c_158(#divsub^#(@x, @y)) , 162: #natadd^#(#0(), @y) -> c_161() , 163: #natadd^#(#s(@x), @y) -> c_162(#natadd^#(@x, @y)) , 164: #natsub^#(@x, #0()) -> c_166() , 165: #natsub^#(#s(@x), #s(@y)) -> c_167(#natsub^#(@x, @y)) } We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^2)). Strict DPs: { add^#(@b1, @b2) -> c_11(add'^#(@b1, @b2, #abs(#0())), #abs^#(#0())) , add'^#(@b1, @b2, @r) -> c_12(add'#1^#(@b1, @b2, @r)) , add'#1^#(::(@x, @xs), @b2, @r) -> c_13(add'#2^#(@b2, @r, @x, @xs)) , add'#2^#(::(@y, @ys), @r, @x, @xs) -> c_15(add'#3^#(sum(@x, @y, @r), @xs, @ys), sum^#(@x, @y, @r)) , add'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_18(add'^#(@xs, @ys, @r')) , sum^#(@x, @y, @r) -> c_17(sum#1^#(+(+(@x, @y), @r)), +^#(+(@x, @y), @r), +^#(@x, @y)) , sum#1^#(@s) -> c_59(sum#2^#(#equal(@s, #0()), @s), #equal^#(@s, #0())) , bitToInt^#(@b) -> c_19(bitToInt'^#(@b, #abs(#pos(#s(#0())))), #abs^#(#pos(#s(#0())))) , bitToInt'^#(@b, @n) -> c_20(bitToInt'#1^#(@b, @n)) , bitToInt'#1^#(::(@x, @xs), @n) -> c_21(+^#(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))), *^#(@x, @n), bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))), *^#(@n, #pos(#s(#s(#0()))))) , compare^#(@b1, @b2) -> c_23(compare#1^#(@b1, @b2)) , compare#1^#(::(@x, @xs), @b2) -> c_24(compare#2^#(@b2, @x, @xs)) , compare#2^#(::(@y, @ys), @x, @xs) -> c_26(compare#3^#(compare(@xs, @ys), @x, @y), compare^#(@xs, @ys)) , compare#3^#(@r, @x, @y) -> c_28(compare#4^#(#equal(@r, #0()), @r, @x, @y), #equal^#(@r, #0())) , compare#4^#(#true(), @r, @x, @y) -> c_30(compare#5^#(#less(@x, @y), @x, @y), #less^#(@x, @y)) , compare#5^#(#false(), @x, @y) -> c_31(compare#6^#(#greater(@x, @y)), #greater^#(@x, @y)) , diff^#(@x, @y, @r) -> c_35(mod^#(+(+(@x, @y), @r), #pos(#s(#s(#0())))), +^#(+(@x, @y), @r), +^#(@x, @y), diff#1^#(#less(-(-(@x, @y), @r), #0())), #less^#(-(-(@x, @y), @r), #0()), -^#(-(@x, @y), @r), -^#(@x, @y)) , leq^#(@b1, @b2) -> c_40(#less^#(compare(@b1, @b2), #pos(#s(#0()))), compare^#(@b1, @b2)) , mult^#(@b1, @b2) -> c_41(mult#1^#(@b1, @b2)) , mult#1^#(::(@x, @xs), @b2) -> c_42(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x), #abs^#(#0()), mult^#(@xs, @b2)) , mult#2^#(@zs, @b2, @x) -> c_44(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs), #equal^#(@x, #pos(#s(#0())))) , mult#3^#(#true(), @b2, @zs) -> c_46(add^#(@b2, @zs)) , mult3^#(@b1, @b2, @b3) -> c_47(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2)) , sub^#(@b1, @b2) -> c_48(sub#1^#(sub'(@b1, @b2, #abs(#0()))), sub'^#(@b1, @b2, #abs(#0())), #abs^#(#0())) , sub'^#(@b1, @b2, @r) -> c_49(sub'#1^#(@b1, @b2, @r)) , sub'#1^#(::(@x, @xs), @b2, @r) -> c_51(sub'#2^#(@b2, @r, @x, @xs)) , sub'#2^#(::(@y, @ys), @r, @x, @xs) -> c_53(sub'#3^#(diff(@x, @y, @r), @xs, @ys), diff^#(@x, @y, @r)) , sub'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_55(sub'#4^#(sub'(@xs, @ys, @r'), @z), sub'^#(@xs, @ys, @r')) , sub'#4^#(tuple#2(@zs, @s), @z) -> c_56(sub'#5^#(#equal(@s, #pos(#s(#0()))), @z, @zs), #equal^#(@s, #pos(#s(#0())))) , sum#2^#(#false(), @s) -> c_60(sum#3^#(#equal(@s, #pos(#s(#0()))), @s), #equal^#(@s, #pos(#s(#0())))) , sum#3^#(#false(), @s) -> c_62(sum#4^#(#equal(@s, #pos(#s(#s(#0()))))), #equal^#(@s, #pos(#s(#s(#0()))))) } Weak DPs: { #abs^#(#0()) -> c_1() , #abs^#(#pos(@x)) -> c_3() , #equal^#(@x, @y) -> c_5(#eq^#(@x, @y)) , #eq^#(#0(), #0()) -> c_66() , #eq^#(#0(), #neg(@y)) -> c_67() , #eq^#(#0(), #pos(@y)) -> c_68() , #eq^#(#0(), #s(@y)) -> c_69() , #eq^#(#neg(@x), #0()) -> c_70() , #eq^#(#neg(@x), #neg(@y)) -> c_71(#eq^#(@x, @y)) , #eq^#(#neg(@x), #pos(@y)) -> c_72() , #eq^#(#pos(@x), #0()) -> c_73() , #eq^#(#pos(@x), #neg(@y)) -> c_74() , #eq^#(#pos(@x), #pos(@y)) -> c_75(#eq^#(@x, @y)) , #eq^#(#s(@x), #0()) -> c_76() , #eq^#(#s(@x), #s(@y)) -> c_77(#eq^#(@x, @y)) , #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) -> c_78(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)), #eq^#(@x_1, @y_1), #eq^#(@x_2, @y_2)) , #eq^#(::(@x_1, @x_2), nil()) -> c_79() , #eq^#(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> c_80() , #eq^#(nil(), ::(@y_1, @y_2)) -> c_81() , #eq^#(nil(), nil()) -> c_82() , #eq^#(nil(), tuple#2(@y_1, @y_2)) -> c_83() , #eq^#(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> c_84() , #eq^#(tuple#2(@x_1, @x_2), nil()) -> c_85() , #eq^#(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> c_86(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)), #eq^#(@x_1, @y_1), #eq^#(@x_2, @y_2)) , #greater^#(@x, @y) -> c_6(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y)) , #ckgt^#(#EQ()) -> c_99() , #ckgt^#(#GT()) -> c_100() , #ckgt^#(#LT()) -> c_101() , #compare^#(#0(), #0()) -> c_87() , #compare^#(#0(), #neg(@y)) -> c_88() , #compare^#(#0(), #pos(@y)) -> c_89() , #compare^#(#0(), #s(@y)) -> c_90() , #compare^#(#neg(@x), #0()) -> c_91() , #compare^#(#neg(@x), #neg(@y)) -> c_92(#compare^#(@y, @x)) , #compare^#(#neg(@x), #pos(@y)) -> c_93() , #compare^#(#pos(@x), #0()) -> c_94() , #compare^#(#pos(@x), #neg(@y)) -> c_95() , #compare^#(#pos(@x), #pos(@y)) -> c_96(#compare^#(@x, @y)) , #compare^#(#s(@x), #0()) -> c_97() , #compare^#(#s(@x), #s(@y)) -> c_98(#compare^#(@x, @y)) , #less^#(@x, @y) -> c_7(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y)) , #cklt^#(#EQ()) -> c_102() , #cklt^#(#GT()) -> c_103() , #cklt^#(#LT()) -> c_104() , *^#(@x, @y) -> c_8(#mult^#(@x, @y)) , #mult^#(#0(), #0()) -> c_105() , #mult^#(#0(), #neg(@y)) -> c_106() , #mult^#(#0(), #pos(@y)) -> c_107() , #mult^#(#neg(@x), #0()) -> c_108() , #mult^#(#neg(@x), #neg(@y)) -> c_109(#natmult^#(@x, @y)) , #mult^#(#neg(@x), #pos(@y)) -> c_110(#natmult^#(@x, @y)) , #mult^#(#pos(@x), #0()) -> c_111() , #mult^#(#pos(@x), #neg(@y)) -> c_112(#natmult^#(@x, @y)) , #mult^#(#pos(@x), #pos(@y)) -> c_113(#natmult^#(@x, @y)) , +^#(@x, @y) -> c_9(#add^#(@x, @y)) , #add^#(#0(), @y) -> c_114() , #add^#(#neg(#s(#0())), @y) -> c_115(#pred^#(@y)) , #add^#(#neg(#s(#s(@x))), @y) -> c_116(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) , #add^#(#pos(#s(#0())), @y) -> c_117(#succ^#(@y)) , #add^#(#pos(#s(#s(@x))), @y) -> c_118(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) , -^#(@x, @y) -> c_10(#sub^#(@x, @y)) , #sub^#(@x, #0()) -> c_119() , #sub^#(@x, #neg(@y)) -> c_120(#add^#(@x, #pos(@y))) , #sub^#(@x, #pos(@y)) -> c_121(#add^#(@x, #neg(@y))) , add'#1^#(nil(), @b2, @r) -> c_14() , add'#2^#(nil(), @r, @x, @xs) -> c_16() , bitToInt'#1^#(nil(), @n) -> c_22(#abs^#(#0())) , compare#1^#(nil(), @b2) -> c_25(#abs^#(#0())) , compare#2^#(nil(), @x, @xs) -> c_27(#abs^#(#0())) , compare#4^#(#false(), @r, @x, @y) -> c_29() , compare#5^#(#true(), @x, @y) -> c_32(-^#(#0(), #pos(#s(#0())))) , compare#6^#(#false()) -> c_33(#abs^#(#0())) , compare#6^#(#true()) -> c_34(#abs^#(#pos(#s(#0())))) , mod^#(@x, @y) -> c_36(-^#(@x, *(@y, div(@x, @y))), *^#(@y, div(@x, @y)), div^#(@x, @y)) , diff#1^#(#false()) -> c_37(#abs^#(#0())) , diff#1^#(#true()) -> c_38(#abs^#(#pos(#s(#0())))) , div^#(@x, @y) -> c_39(#div^#(@x, @y)) , #div^#(#0(), #0()) -> c_122() , #div^#(#0(), #neg(@y)) -> c_123() , #div^#(#0(), #pos(@y)) -> c_124() , #div^#(#neg(@x), #0()) -> c_125() , #div^#(#neg(@x), #neg(@y)) -> c_126(#positive^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) , #div^#(#neg(@x), #pos(@y)) -> c_127(#negative^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) , #div^#(#pos(@x), #0()) -> c_128() , #div^#(#pos(@x), #neg(@y)) -> c_129(#negative^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) , #div^#(#pos(@x), #pos(@y)) -> c_130(#positive^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) , mult#1^#(nil(), @b2) -> c_43() , mult#3^#(#false(), @b2, @zs) -> c_45() , sub#1^#(tuple#2(@b, @_@1)) -> c_50() , sub'#1^#(nil(), @b2, @r) -> c_52() , sub'#2^#(nil(), @r, @x, @xs) -> c_54() , sub'#5^#(#false(), @z, @zs) -> c_57() , sub'#5^#(#true(), @z, @zs) -> c_58(#abs^#(#0())) , sum#2^#(#true(), @s) -> c_61(#abs^#(#0()), #abs^#(#0())) , sum#3^#(#true(), @s) -> c_63(#abs^#(#pos(#s(#0()))), #abs^#(#0())) , sum#4^#(#false()) -> c_64(#abs^#(#pos(#s(#0()))), #abs^#(#pos(#s(#0())))) , sum#4^#(#true()) -> c_65(#abs^#(#0()), #abs^#(#pos(#s(#0())))) , #and^#(#false(), #false()) -> c_139() , #and^#(#false(), #true()) -> c_140() , #and^#(#true(), #false()) -> c_141() , #and^#(#true(), #true()) -> c_142() , #natmult^#(#0(), @y) -> c_159() , #natmult^#(#s(@x), @y) -> c_160(#natadd^#(@y, #natmult(@x, @y)), #natmult^#(@x, @y)) , #pred^#(#0()) -> c_131() , #pred^#(#neg(#s(@x))) -> c_132() , #pred^#(#pos(#s(#0()))) -> c_133() , #pred^#(#pos(#s(#s(@x)))) -> c_134() , #succ^#(#0()) -> c_135() , #succ^#(#neg(#s(#0()))) -> c_136() , #succ^#(#neg(#s(#s(@x)))) -> c_137() , #succ^#(#pos(#s(@x))) -> c_138() , #positive^#(#0()) -> c_147() , #positive^#(#neg(@x)) -> c_148() , #positive^#(#pos(@x)) -> c_149() , #positive^#(#s(@x)) -> c_150() , #natdiv^#(#0(), #0()) -> c_143() , #natdiv^#(#0(), #s(@y)) -> c_144() , #natdiv^#(#s(@x), #0()) -> c_145() , #natdiv^#(#s(@x), #s(@y)) -> c_146(#natdiv'^#(#divsub(@x, @y), #s(@y)), #divsub^#(@x, @y)) , #negative^#(#0()) -> c_151() , #negative^#(#neg(@x)) -> c_152() , #negative^#(#pos(@x)) -> c_153() , #negative^#(#s(@x)) -> c_154() , #natdiv'^#(#0(), @y) -> c_163() , #natdiv'^#(#s(@x), @y) -> c_164(#natdiv^#(#s(@x), @y)) , #natdiv'^#(#underflow(), @y) -> c_165() , #divsub^#(#0(), #0()) -> c_155() , #divsub^#(#0(), #s(@y)) -> c_156() , #divsub^#(#s(@x), #0()) -> c_157() , #divsub^#(#s(@x), #s(@y)) -> c_158(#divsub^#(@x, @y)) , #natadd^#(#0(), @y) -> c_161() , #natadd^#(#s(@x), @y) -> c_162(#natadd^#(@x, @y)) , #natsub^#(@x, #0()) -> c_166() , #natsub^#(#s(@x), #s(@y)) -> c_167(#natsub^#(@x, @y)) } Weak Trs: { #abs(#0()) -> #0() , #abs(#neg(@x)) -> #pos(@x) , #abs(#pos(@x)) -> #pos(@x) , #abs(#s(@x)) -> #pos(#s(@x)) , #equal(@x, @y) -> #eq(@x, @y) , #eq(#0(), #0()) -> #true() , #eq(#0(), #neg(@y)) -> #false() , #eq(#0(), #pos(@y)) -> #false() , #eq(#0(), #s(@y)) -> #false() , #eq(#neg(@x), #0()) -> #false() , #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #pos(@y)) -> #false() , #eq(#pos(@x), #0()) -> #false() , #eq(#pos(@x), #neg(@y)) -> #false() , #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y) , #eq(#s(@x), #0()) -> #false() , #eq(#s(@x), #s(@y)) -> #eq(@x, @y) , #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #eq(::(@x_1, @x_2), nil()) -> #false() , #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false() , #eq(nil(), ::(@y_1, @y_2)) -> #false() , #eq(nil(), nil()) -> #true() , #eq(nil(), tuple#2(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), nil()) -> #false() , #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #greater(@x, @y) -> #ckgt(#compare(@x, @y)) , #compare(#0(), #0()) -> #EQ() , #compare(#0(), #neg(@y)) -> #GT() , #compare(#0(), #pos(@y)) -> #LT() , #compare(#0(), #s(@y)) -> #LT() , #compare(#neg(@x), #0()) -> #LT() , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x) , #compare(#neg(@x), #pos(@y)) -> #LT() , #compare(#pos(@x), #0()) -> #GT() , #compare(#pos(@x), #neg(@y)) -> #GT() , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y) , #compare(#s(@x), #0()) -> #GT() , #compare(#s(@x), #s(@y)) -> #compare(@x, @y) , #ckgt(#EQ()) -> #false() , #ckgt(#GT()) -> #true() , #ckgt(#LT()) -> #false() , #less(@x, @y) -> #cklt(#compare(@x, @y)) , #cklt(#EQ()) -> #false() , #cklt(#GT()) -> #false() , #cklt(#LT()) -> #true() , *(@x, @y) -> #mult(@x, @y) , #mult(#0(), #0()) -> #0() , #mult(#0(), #neg(@y)) -> #0() , #mult(#0(), #pos(@y)) -> #0() , #mult(#neg(@x), #0()) -> #0() , #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y)) , #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #0()) -> #0() , #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y)) , +(@x, @y) -> #add(@x, @y) , #add(#0(), @y) -> @y , #add(#neg(#s(#0())), @y) -> #pred(@y) , #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y)) , #add(#pos(#s(#0())), @y) -> #succ(@y) , #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y)) , -(@x, @y) -> #sub(@x, @y) , #sub(@x, #0()) -> @x , #sub(@x, #neg(@y)) -> #add(@x, #pos(@y)) , #sub(@x, #pos(@y)) -> #add(@x, #neg(@y)) , add(@b1, @b2) -> add'(@b1, @b2, #abs(#0())) , add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r) , add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs) , add'#1(nil(), @b2, @r) -> nil() , add'#2(::(@y, @ys), @r, @x, @xs) -> add'#3(sum(@x, @y, @r), @xs, @ys) , add'#2(nil(), @r, @x, @xs) -> nil() , sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r)) , add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r')) , bitToInt(@b) -> bitToInt'(@b, #abs(#pos(#s(#0())))) , bitToInt'(@b, @n) -> bitToInt'#1(@b, @n) , bitToInt'#1(::(@x, @xs), @n) -> +(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))) , bitToInt'#1(nil(), @n) -> #abs(#0()) , compare(@b1, @b2) -> compare#1(@b1, @b2) , compare#1(::(@x, @xs), @b2) -> compare#2(@b2, @x, @xs) , compare#1(nil(), @b2) -> #abs(#0()) , compare#2(::(@y, @ys), @x, @xs) -> compare#3(compare(@xs, @ys), @x, @y) , compare#2(nil(), @x, @xs) -> #abs(#0()) , compare#3(@r, @x, @y) -> compare#4(#equal(@r, #0()), @r, @x, @y) , compare#4(#false(), @r, @x, @y) -> @r , compare#4(#true(), @r, @x, @y) -> compare#5(#less(@x, @y), @x, @y) , compare#5(#false(), @x, @y) -> compare#6(#greater(@x, @y)) , compare#5(#true(), @x, @y) -> -(#0(), #pos(#s(#0()))) , compare#6(#false()) -> #abs(#0()) , compare#6(#true()) -> #abs(#pos(#s(#0()))) , diff(@x, @y, @r) -> tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))), diff#1(#less(-(-(@x, @y), @r), #0()))) , mod(@x, @y) -> -(@x, *(@y, div(@x, @y))) , diff#1(#false()) -> #abs(#0()) , diff#1(#true()) -> #abs(#pos(#s(#0()))) , div(@x, @y) -> #div(@x, @y) , #div(#0(), #0()) -> #divByZero() , #div(#0(), #neg(@y)) -> #0() , #div(#0(), #pos(@y)) -> #0() , #div(#neg(@x), #0()) -> #divByZero() , #div(#neg(@x), #neg(@y)) -> #positive(#natdiv(@x, @y)) , #div(#neg(@x), #pos(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #0()) -> #divByZero() , #div(#pos(@x), #neg(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #pos(@y)) -> #positive(#natdiv(@x, @y)) , leq(@b1, @b2) -> #less(compare(@b1, @b2), #pos(#s(#0()))) , mult(@b1, @b2) -> mult#1(@b1, @b2) , mult#1(::(@x, @xs), @b2) -> mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x) , mult#1(nil(), @b2) -> nil() , mult#2(@zs, @b2, @x) -> mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs) , mult#3(#false(), @b2, @zs) -> @zs , mult#3(#true(), @b2, @zs) -> add(@b2, @zs) , mult3(@b1, @b2, @b3) -> mult(mult(@b1, @b2), @b2) , sub(@b1, @b2) -> sub#1(sub'(@b1, @b2, #abs(#0()))) , sub'(@b1, @b2, @r) -> sub'#1(@b1, @b2, @r) , sub#1(tuple#2(@b, @_@1)) -> @b , sub'#1(::(@x, @xs), @b2, @r) -> sub'#2(@b2, @r, @x, @xs) , sub'#1(nil(), @b2, @r) -> tuple#2(nil(), @r) , sub'#2(::(@y, @ys), @r, @x, @xs) -> sub'#3(diff(@x, @y, @r), @xs, @ys) , sub'#2(nil(), @r, @x, @xs) -> tuple#2(nil(), @r) , sub'#3(tuple#2(@z, @r'), @xs, @ys) -> sub'#4(sub'(@xs, @ys, @r'), @z) , sub'#4(tuple#2(@zs, @s), @z) -> tuple#2(sub'#5(#equal(@s, #pos(#s(#0()))), @z, @zs), @s) , sub'#5(#false(), @z, @zs) -> ::(@z, @zs) , sub'#5(#true(), @z, @zs) -> ::(#abs(#0()), @zs) , sum#1(@s) -> sum#2(#equal(@s, #0()), @s) , sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s) , sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0())) , sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0()))))) , sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0())) , sum#4(#false()) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0())))) , sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0())))) , #pred(#0()) -> #neg(#s(#0())) , #pred(#neg(#s(@x))) -> #neg(#s(#s(@x))) , #pred(#pos(#s(#0()))) -> #0() , #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x)) , #succ(#0()) -> #pos(#s(#0())) , #succ(#neg(#s(#0()))) -> #0() , #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x)) , #succ(#pos(#s(@x))) -> #pos(#s(#s(@x))) , #and(#false(), #false()) -> #false() , #and(#false(), #true()) -> #false() , #and(#true(), #false()) -> #false() , #and(#true(), #true()) -> #true() , #natdiv(#0(), #0()) -> #divByZero() , #natdiv(#0(), #s(@y)) -> #0() , #natdiv(#s(@x), #0()) -> #divByZero() , #natdiv(#s(@x), #s(@y)) -> #natdiv'(#divsub(@x, @y), #s(@y)) , #positive(#0()) -> #0() , #positive(#neg(@x)) -> #neg(@x) , #positive(#pos(@x)) -> #pos(@x) , #positive(#s(@x)) -> #pos(#s(@x)) , #negative(#0()) -> #0() , #negative(#neg(@x)) -> #pos(@x) , #negative(#pos(@x)) -> #neg(@x) , #negative(#s(@x)) -> #neg(#s(@x)) , #divsub(#0(), #0()) -> #0() , #divsub(#0(), #s(@y)) -> #underflow() , #divsub(#s(@x), #0()) -> #s(@x) , #divsub(#s(@x), #s(@y)) -> #divsub(@x, @y) , #natmult(#0(), @y) -> #0() , #natmult(#s(@x), @y) -> #natadd(@y, #natmult(@x, @y)) , #natadd(#0(), @y) -> @y , #natadd(#s(@x), @y) -> #s(#natadd(@x, @y)) , #natdiv'(#0(), @y) -> #s(#0()) , #natdiv'(#s(@x), @y) -> #s(#natdiv(#s(@x), @y)) , #natdiv'(#underflow(), @y) -> #0() , #natsub(@x, #0()) -> @x , #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^2)) We estimate the number of application of {16,17,29,31} by applications of Pre({16,17,29,31}) = {15,27,28,30}. Here rules are labeled as follows: DPs: { 1: add^#(@b1, @b2) -> c_11(add'^#(@b1, @b2, #abs(#0())), #abs^#(#0())) , 2: add'^#(@b1, @b2, @r) -> c_12(add'#1^#(@b1, @b2, @r)) , 3: add'#1^#(::(@x, @xs), @b2, @r) -> c_13(add'#2^#(@b2, @r, @x, @xs)) , 4: add'#2^#(::(@y, @ys), @r, @x, @xs) -> c_15(add'#3^#(sum(@x, @y, @r), @xs, @ys), sum^#(@x, @y, @r)) , 5: add'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_18(add'^#(@xs, @ys, @r')) , 6: sum^#(@x, @y, @r) -> c_17(sum#1^#(+(+(@x, @y), @r)), +^#(+(@x, @y), @r), +^#(@x, @y)) , 7: sum#1^#(@s) -> c_59(sum#2^#(#equal(@s, #0()), @s), #equal^#(@s, #0())) , 8: bitToInt^#(@b) -> c_19(bitToInt'^#(@b, #abs(#pos(#s(#0())))), #abs^#(#pos(#s(#0())))) , 9: bitToInt'^#(@b, @n) -> c_20(bitToInt'#1^#(@b, @n)) , 10: bitToInt'#1^#(::(@x, @xs), @n) -> c_21(+^#(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))), *^#(@x, @n), bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))), *^#(@n, #pos(#s(#s(#0()))))) , 11: compare^#(@b1, @b2) -> c_23(compare#1^#(@b1, @b2)) , 12: compare#1^#(::(@x, @xs), @b2) -> c_24(compare#2^#(@b2, @x, @xs)) , 13: compare#2^#(::(@y, @ys), @x, @xs) -> c_26(compare#3^#(compare(@xs, @ys), @x, @y), compare^#(@xs, @ys)) , 14: compare#3^#(@r, @x, @y) -> c_28(compare#4^#(#equal(@r, #0()), @r, @x, @y), #equal^#(@r, #0())) , 15: compare#4^#(#true(), @r, @x, @y) -> c_30(compare#5^#(#less(@x, @y), @x, @y), #less^#(@x, @y)) , 16: compare#5^#(#false(), @x, @y) -> c_31(compare#6^#(#greater(@x, @y)), #greater^#(@x, @y)) , 17: diff^#(@x, @y, @r) -> c_35(mod^#(+(+(@x, @y), @r), #pos(#s(#s(#0())))), +^#(+(@x, @y), @r), +^#(@x, @y), diff#1^#(#less(-(-(@x, @y), @r), #0())), #less^#(-(-(@x, @y), @r), #0()), -^#(-(@x, @y), @r), -^#(@x, @y)) , 18: leq^#(@b1, @b2) -> c_40(#less^#(compare(@b1, @b2), #pos(#s(#0()))), compare^#(@b1, @b2)) , 19: mult^#(@b1, @b2) -> c_41(mult#1^#(@b1, @b2)) , 20: mult#1^#(::(@x, @xs), @b2) -> c_42(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x), #abs^#(#0()), mult^#(@xs, @b2)) , 21: mult#2^#(@zs, @b2, @x) -> c_44(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs), #equal^#(@x, #pos(#s(#0())))) , 22: mult#3^#(#true(), @b2, @zs) -> c_46(add^#(@b2, @zs)) , 23: mult3^#(@b1, @b2, @b3) -> c_47(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2)) , 24: sub^#(@b1, @b2) -> c_48(sub#1^#(sub'(@b1, @b2, #abs(#0()))), sub'^#(@b1, @b2, #abs(#0())), #abs^#(#0())) , 25: sub'^#(@b1, @b2, @r) -> c_49(sub'#1^#(@b1, @b2, @r)) , 26: sub'#1^#(::(@x, @xs), @b2, @r) -> c_51(sub'#2^#(@b2, @r, @x, @xs)) , 27: sub'#2^#(::(@y, @ys), @r, @x, @xs) -> c_53(sub'#3^#(diff(@x, @y, @r), @xs, @ys), diff^#(@x, @y, @r)) , 28: sub'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_55(sub'#4^#(sub'(@xs, @ys, @r'), @z), sub'^#(@xs, @ys, @r')) , 29: sub'#4^#(tuple#2(@zs, @s), @z) -> c_56(sub'#5^#(#equal(@s, #pos(#s(#0()))), @z, @zs), #equal^#(@s, #pos(#s(#0())))) , 30: sum#2^#(#false(), @s) -> c_60(sum#3^#(#equal(@s, #pos(#s(#0()))), @s), #equal^#(@s, #pos(#s(#0())))) , 31: sum#3^#(#false(), @s) -> c_62(sum#4^#(#equal(@s, #pos(#s(#s(#0()))))), #equal^#(@s, #pos(#s(#s(#0()))))) , 32: #abs^#(#0()) -> c_1() , 33: #abs^#(#pos(@x)) -> c_3() , 34: #equal^#(@x, @y) -> c_5(#eq^#(@x, @y)) , 35: #eq^#(#0(), #0()) -> c_66() , 36: #eq^#(#0(), #neg(@y)) -> c_67() , 37: #eq^#(#0(), #pos(@y)) -> c_68() , 38: #eq^#(#0(), #s(@y)) -> c_69() , 39: #eq^#(#neg(@x), #0()) -> c_70() , 40: #eq^#(#neg(@x), #neg(@y)) -> c_71(#eq^#(@x, @y)) , 41: #eq^#(#neg(@x), #pos(@y)) -> c_72() , 42: #eq^#(#pos(@x), #0()) -> c_73() , 43: #eq^#(#pos(@x), #neg(@y)) -> c_74() , 44: #eq^#(#pos(@x), #pos(@y)) -> c_75(#eq^#(@x, @y)) , 45: #eq^#(#s(@x), #0()) -> c_76() , 46: #eq^#(#s(@x), #s(@y)) -> c_77(#eq^#(@x, @y)) , 47: #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) -> c_78(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)), #eq^#(@x_1, @y_1), #eq^#(@x_2, @y_2)) , 48: #eq^#(::(@x_1, @x_2), nil()) -> c_79() , 49: #eq^#(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> c_80() , 50: #eq^#(nil(), ::(@y_1, @y_2)) -> c_81() , 51: #eq^#(nil(), nil()) -> c_82() , 52: #eq^#(nil(), tuple#2(@y_1, @y_2)) -> c_83() , 53: #eq^#(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> c_84() , 54: #eq^#(tuple#2(@x_1, @x_2), nil()) -> c_85() , 55: #eq^#(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> c_86(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)), #eq^#(@x_1, @y_1), #eq^#(@x_2, @y_2)) , 56: #greater^#(@x, @y) -> c_6(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y)) , 57: #ckgt^#(#EQ()) -> c_99() , 58: #ckgt^#(#GT()) -> c_100() , 59: #ckgt^#(#LT()) -> c_101() , 60: #compare^#(#0(), #0()) -> c_87() , 61: #compare^#(#0(), #neg(@y)) -> c_88() , 62: #compare^#(#0(), #pos(@y)) -> c_89() , 63: #compare^#(#0(), #s(@y)) -> c_90() , 64: #compare^#(#neg(@x), #0()) -> c_91() , 65: #compare^#(#neg(@x), #neg(@y)) -> c_92(#compare^#(@y, @x)) , 66: #compare^#(#neg(@x), #pos(@y)) -> c_93() , 67: #compare^#(#pos(@x), #0()) -> c_94() , 68: #compare^#(#pos(@x), #neg(@y)) -> c_95() , 69: #compare^#(#pos(@x), #pos(@y)) -> c_96(#compare^#(@x, @y)) , 70: #compare^#(#s(@x), #0()) -> c_97() , 71: #compare^#(#s(@x), #s(@y)) -> c_98(#compare^#(@x, @y)) , 72: #less^#(@x, @y) -> c_7(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y)) , 73: #cklt^#(#EQ()) -> c_102() , 74: #cklt^#(#GT()) -> c_103() , 75: #cklt^#(#LT()) -> c_104() , 76: *^#(@x, @y) -> c_8(#mult^#(@x, @y)) , 77: #mult^#(#0(), #0()) -> c_105() , 78: #mult^#(#0(), #neg(@y)) -> c_106() , 79: #mult^#(#0(), #pos(@y)) -> c_107() , 80: #mult^#(#neg(@x), #0()) -> c_108() , 81: #mult^#(#neg(@x), #neg(@y)) -> c_109(#natmult^#(@x, @y)) , 82: #mult^#(#neg(@x), #pos(@y)) -> c_110(#natmult^#(@x, @y)) , 83: #mult^#(#pos(@x), #0()) -> c_111() , 84: #mult^#(#pos(@x), #neg(@y)) -> c_112(#natmult^#(@x, @y)) , 85: #mult^#(#pos(@x), #pos(@y)) -> c_113(#natmult^#(@x, @y)) , 86: +^#(@x, @y) -> c_9(#add^#(@x, @y)) , 87: #add^#(#0(), @y) -> c_114() , 88: #add^#(#neg(#s(#0())), @y) -> c_115(#pred^#(@y)) , 89: #add^#(#neg(#s(#s(@x))), @y) -> c_116(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) , 90: #add^#(#pos(#s(#0())), @y) -> c_117(#succ^#(@y)) , 91: #add^#(#pos(#s(#s(@x))), @y) -> c_118(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) , 92: -^#(@x, @y) -> c_10(#sub^#(@x, @y)) , 93: #sub^#(@x, #0()) -> c_119() , 94: #sub^#(@x, #neg(@y)) -> c_120(#add^#(@x, #pos(@y))) , 95: #sub^#(@x, #pos(@y)) -> c_121(#add^#(@x, #neg(@y))) , 96: add'#1^#(nil(), @b2, @r) -> c_14() , 97: add'#2^#(nil(), @r, @x, @xs) -> c_16() , 98: bitToInt'#1^#(nil(), @n) -> c_22(#abs^#(#0())) , 99: compare#1^#(nil(), @b2) -> c_25(#abs^#(#0())) , 100: compare#2^#(nil(), @x, @xs) -> c_27(#abs^#(#0())) , 101: compare#4^#(#false(), @r, @x, @y) -> c_29() , 102: compare#5^#(#true(), @x, @y) -> c_32(-^#(#0(), #pos(#s(#0())))) , 103: compare#6^#(#false()) -> c_33(#abs^#(#0())) , 104: compare#6^#(#true()) -> c_34(#abs^#(#pos(#s(#0())))) , 105: mod^#(@x, @y) -> c_36(-^#(@x, *(@y, div(@x, @y))), *^#(@y, div(@x, @y)), div^#(@x, @y)) , 106: diff#1^#(#false()) -> c_37(#abs^#(#0())) , 107: diff#1^#(#true()) -> c_38(#abs^#(#pos(#s(#0())))) , 108: div^#(@x, @y) -> c_39(#div^#(@x, @y)) , 109: #div^#(#0(), #0()) -> c_122() , 110: #div^#(#0(), #neg(@y)) -> c_123() , 111: #div^#(#0(), #pos(@y)) -> c_124() , 112: #div^#(#neg(@x), #0()) -> c_125() , 113: #div^#(#neg(@x), #neg(@y)) -> c_126(#positive^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) , 114: #div^#(#neg(@x), #pos(@y)) -> c_127(#negative^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) , 115: #div^#(#pos(@x), #0()) -> c_128() , 116: #div^#(#pos(@x), #neg(@y)) -> c_129(#negative^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) , 117: #div^#(#pos(@x), #pos(@y)) -> c_130(#positive^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) , 118: mult#1^#(nil(), @b2) -> c_43() , 119: mult#3^#(#false(), @b2, @zs) -> c_45() , 120: sub#1^#(tuple#2(@b, @_@1)) -> c_50() , 121: sub'#1^#(nil(), @b2, @r) -> c_52() , 122: sub'#2^#(nil(), @r, @x, @xs) -> c_54() , 123: sub'#5^#(#false(), @z, @zs) -> c_57() , 124: sub'#5^#(#true(), @z, @zs) -> c_58(#abs^#(#0())) , 125: sum#2^#(#true(), @s) -> c_61(#abs^#(#0()), #abs^#(#0())) , 126: sum#3^#(#true(), @s) -> c_63(#abs^#(#pos(#s(#0()))), #abs^#(#0())) , 127: sum#4^#(#false()) -> c_64(#abs^#(#pos(#s(#0()))), #abs^#(#pos(#s(#0())))) , 128: sum#4^#(#true()) -> c_65(#abs^#(#0()), #abs^#(#pos(#s(#0())))) , 129: #and^#(#false(), #false()) -> c_139() , 130: #and^#(#false(), #true()) -> c_140() , 131: #and^#(#true(), #false()) -> c_141() , 132: #and^#(#true(), #true()) -> c_142() , 133: #natmult^#(#0(), @y) -> c_159() , 134: #natmult^#(#s(@x), @y) -> c_160(#natadd^#(@y, #natmult(@x, @y)), #natmult^#(@x, @y)) , 135: #pred^#(#0()) -> c_131() , 136: #pred^#(#neg(#s(@x))) -> c_132() , 137: #pred^#(#pos(#s(#0()))) -> c_133() , 138: #pred^#(#pos(#s(#s(@x)))) -> c_134() , 139: #succ^#(#0()) -> c_135() , 140: #succ^#(#neg(#s(#0()))) -> c_136() , 141: #succ^#(#neg(#s(#s(@x)))) -> c_137() , 142: #succ^#(#pos(#s(@x))) -> c_138() , 143: #positive^#(#0()) -> c_147() , 144: #positive^#(#neg(@x)) -> c_148() , 145: #positive^#(#pos(@x)) -> c_149() , 146: #positive^#(#s(@x)) -> c_150() , 147: #natdiv^#(#0(), #0()) -> c_143() , 148: #natdiv^#(#0(), #s(@y)) -> c_144() , 149: #natdiv^#(#s(@x), #0()) -> c_145() , 150: #natdiv^#(#s(@x), #s(@y)) -> c_146(#natdiv'^#(#divsub(@x, @y), #s(@y)), #divsub^#(@x, @y)) , 151: #negative^#(#0()) -> c_151() , 152: #negative^#(#neg(@x)) -> c_152() , 153: #negative^#(#pos(@x)) -> c_153() , 154: #negative^#(#s(@x)) -> c_154() , 155: #natdiv'^#(#0(), @y) -> c_163() , 156: #natdiv'^#(#s(@x), @y) -> c_164(#natdiv^#(#s(@x), @y)) , 157: #natdiv'^#(#underflow(), @y) -> c_165() , 158: #divsub^#(#0(), #0()) -> c_155() , 159: #divsub^#(#0(), #s(@y)) -> c_156() , 160: #divsub^#(#s(@x), #0()) -> c_157() , 161: #divsub^#(#s(@x), #s(@y)) -> c_158(#divsub^#(@x, @y)) , 162: #natadd^#(#0(), @y) -> c_161() , 163: #natadd^#(#s(@x), @y) -> c_162(#natadd^#(@x, @y)) , 164: #natsub^#(@x, #0()) -> c_166() , 165: #natsub^#(#s(@x), #s(@y)) -> c_167(#natsub^#(@x, @y)) } We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^2)). Strict DPs: { add^#(@b1, @b2) -> c_11(add'^#(@b1, @b2, #abs(#0())), #abs^#(#0())) , add'^#(@b1, @b2, @r) -> c_12(add'#1^#(@b1, @b2, @r)) , add'#1^#(::(@x, @xs), @b2, @r) -> c_13(add'#2^#(@b2, @r, @x, @xs)) , add'#2^#(::(@y, @ys), @r, @x, @xs) -> c_15(add'#3^#(sum(@x, @y, @r), @xs, @ys), sum^#(@x, @y, @r)) , add'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_18(add'^#(@xs, @ys, @r')) , sum^#(@x, @y, @r) -> c_17(sum#1^#(+(+(@x, @y), @r)), +^#(+(@x, @y), @r), +^#(@x, @y)) , sum#1^#(@s) -> c_59(sum#2^#(#equal(@s, #0()), @s), #equal^#(@s, #0())) , bitToInt^#(@b) -> c_19(bitToInt'^#(@b, #abs(#pos(#s(#0())))), #abs^#(#pos(#s(#0())))) , bitToInt'^#(@b, @n) -> c_20(bitToInt'#1^#(@b, @n)) , bitToInt'#1^#(::(@x, @xs), @n) -> c_21(+^#(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))), *^#(@x, @n), bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))), *^#(@n, #pos(#s(#s(#0()))))) , compare^#(@b1, @b2) -> c_23(compare#1^#(@b1, @b2)) , compare#1^#(::(@x, @xs), @b2) -> c_24(compare#2^#(@b2, @x, @xs)) , compare#2^#(::(@y, @ys), @x, @xs) -> c_26(compare#3^#(compare(@xs, @ys), @x, @y), compare^#(@xs, @ys)) , compare#3^#(@r, @x, @y) -> c_28(compare#4^#(#equal(@r, #0()), @r, @x, @y), #equal^#(@r, #0())) , compare#4^#(#true(), @r, @x, @y) -> c_30(compare#5^#(#less(@x, @y), @x, @y), #less^#(@x, @y)) , leq^#(@b1, @b2) -> c_40(#less^#(compare(@b1, @b2), #pos(#s(#0()))), compare^#(@b1, @b2)) , mult^#(@b1, @b2) -> c_41(mult#1^#(@b1, @b2)) , mult#1^#(::(@x, @xs), @b2) -> c_42(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x), #abs^#(#0()), mult^#(@xs, @b2)) , mult#2^#(@zs, @b2, @x) -> c_44(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs), #equal^#(@x, #pos(#s(#0())))) , mult#3^#(#true(), @b2, @zs) -> c_46(add^#(@b2, @zs)) , mult3^#(@b1, @b2, @b3) -> c_47(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2)) , sub^#(@b1, @b2) -> c_48(sub#1^#(sub'(@b1, @b2, #abs(#0()))), sub'^#(@b1, @b2, #abs(#0())), #abs^#(#0())) , sub'^#(@b1, @b2, @r) -> c_49(sub'#1^#(@b1, @b2, @r)) , sub'#1^#(::(@x, @xs), @b2, @r) -> c_51(sub'#2^#(@b2, @r, @x, @xs)) , sub'#2^#(::(@y, @ys), @r, @x, @xs) -> c_53(sub'#3^#(diff(@x, @y, @r), @xs, @ys), diff^#(@x, @y, @r)) , sub'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_55(sub'#4^#(sub'(@xs, @ys, @r'), @z), sub'^#(@xs, @ys, @r')) , sum#2^#(#false(), @s) -> c_60(sum#3^#(#equal(@s, #pos(#s(#0()))), @s), #equal^#(@s, #pos(#s(#0())))) } Weak DPs: { #abs^#(#0()) -> c_1() , #abs^#(#pos(@x)) -> c_3() , #equal^#(@x, @y) -> c_5(#eq^#(@x, @y)) , #eq^#(#0(), #0()) -> c_66() , #eq^#(#0(), #neg(@y)) -> c_67() , #eq^#(#0(), #pos(@y)) -> c_68() , #eq^#(#0(), #s(@y)) -> c_69() , #eq^#(#neg(@x), #0()) -> c_70() , #eq^#(#neg(@x), #neg(@y)) -> c_71(#eq^#(@x, @y)) , #eq^#(#neg(@x), #pos(@y)) -> c_72() , #eq^#(#pos(@x), #0()) -> c_73() , #eq^#(#pos(@x), #neg(@y)) -> c_74() , #eq^#(#pos(@x), #pos(@y)) -> c_75(#eq^#(@x, @y)) , #eq^#(#s(@x), #0()) -> c_76() , #eq^#(#s(@x), #s(@y)) -> c_77(#eq^#(@x, @y)) , #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) -> c_78(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)), #eq^#(@x_1, @y_1), #eq^#(@x_2, @y_2)) , #eq^#(::(@x_1, @x_2), nil()) -> c_79() , #eq^#(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> c_80() , #eq^#(nil(), ::(@y_1, @y_2)) -> c_81() , #eq^#(nil(), nil()) -> c_82() , #eq^#(nil(), tuple#2(@y_1, @y_2)) -> c_83() , #eq^#(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> c_84() , #eq^#(tuple#2(@x_1, @x_2), nil()) -> c_85() , #eq^#(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> c_86(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)), #eq^#(@x_1, @y_1), #eq^#(@x_2, @y_2)) , #greater^#(@x, @y) -> c_6(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y)) , #ckgt^#(#EQ()) -> c_99() , #ckgt^#(#GT()) -> c_100() , #ckgt^#(#LT()) -> c_101() , #compare^#(#0(), #0()) -> c_87() , #compare^#(#0(), #neg(@y)) -> c_88() , #compare^#(#0(), #pos(@y)) -> c_89() , #compare^#(#0(), #s(@y)) -> c_90() , #compare^#(#neg(@x), #0()) -> c_91() , #compare^#(#neg(@x), #neg(@y)) -> c_92(#compare^#(@y, @x)) , #compare^#(#neg(@x), #pos(@y)) -> c_93() , #compare^#(#pos(@x), #0()) -> c_94() , #compare^#(#pos(@x), #neg(@y)) -> c_95() , #compare^#(#pos(@x), #pos(@y)) -> c_96(#compare^#(@x, @y)) , #compare^#(#s(@x), #0()) -> c_97() , #compare^#(#s(@x), #s(@y)) -> c_98(#compare^#(@x, @y)) , #less^#(@x, @y) -> c_7(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y)) , #cklt^#(#EQ()) -> c_102() , #cklt^#(#GT()) -> c_103() , #cklt^#(#LT()) -> c_104() , *^#(@x, @y) -> c_8(#mult^#(@x, @y)) , #mult^#(#0(), #0()) -> c_105() , #mult^#(#0(), #neg(@y)) -> c_106() , #mult^#(#0(), #pos(@y)) -> c_107() , #mult^#(#neg(@x), #0()) -> c_108() , #mult^#(#neg(@x), #neg(@y)) -> c_109(#natmult^#(@x, @y)) , #mult^#(#neg(@x), #pos(@y)) -> c_110(#natmult^#(@x, @y)) , #mult^#(#pos(@x), #0()) -> c_111() , #mult^#(#pos(@x), #neg(@y)) -> c_112(#natmult^#(@x, @y)) , #mult^#(#pos(@x), #pos(@y)) -> c_113(#natmult^#(@x, @y)) , +^#(@x, @y) -> c_9(#add^#(@x, @y)) , #add^#(#0(), @y) -> c_114() , #add^#(#neg(#s(#0())), @y) -> c_115(#pred^#(@y)) , #add^#(#neg(#s(#s(@x))), @y) -> c_116(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) , #add^#(#pos(#s(#0())), @y) -> c_117(#succ^#(@y)) , #add^#(#pos(#s(#s(@x))), @y) -> c_118(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) , -^#(@x, @y) -> c_10(#sub^#(@x, @y)) , #sub^#(@x, #0()) -> c_119() , #sub^#(@x, #neg(@y)) -> c_120(#add^#(@x, #pos(@y))) , #sub^#(@x, #pos(@y)) -> c_121(#add^#(@x, #neg(@y))) , add'#1^#(nil(), @b2, @r) -> c_14() , add'#2^#(nil(), @r, @x, @xs) -> c_16() , bitToInt'#1^#(nil(), @n) -> c_22(#abs^#(#0())) , compare#1^#(nil(), @b2) -> c_25(#abs^#(#0())) , compare#2^#(nil(), @x, @xs) -> c_27(#abs^#(#0())) , compare#4^#(#false(), @r, @x, @y) -> c_29() , compare#5^#(#false(), @x, @y) -> c_31(compare#6^#(#greater(@x, @y)), #greater^#(@x, @y)) , compare#5^#(#true(), @x, @y) -> c_32(-^#(#0(), #pos(#s(#0())))) , compare#6^#(#false()) -> c_33(#abs^#(#0())) , compare#6^#(#true()) -> c_34(#abs^#(#pos(#s(#0())))) , diff^#(@x, @y, @r) -> c_35(mod^#(+(+(@x, @y), @r), #pos(#s(#s(#0())))), +^#(+(@x, @y), @r), +^#(@x, @y), diff#1^#(#less(-(-(@x, @y), @r), #0())), #less^#(-(-(@x, @y), @r), #0()), -^#(-(@x, @y), @r), -^#(@x, @y)) , mod^#(@x, @y) -> c_36(-^#(@x, *(@y, div(@x, @y))), *^#(@y, div(@x, @y)), div^#(@x, @y)) , diff#1^#(#false()) -> c_37(#abs^#(#0())) , diff#1^#(#true()) -> c_38(#abs^#(#pos(#s(#0())))) , div^#(@x, @y) -> c_39(#div^#(@x, @y)) , #div^#(#0(), #0()) -> c_122() , #div^#(#0(), #neg(@y)) -> c_123() , #div^#(#0(), #pos(@y)) -> c_124() , #div^#(#neg(@x), #0()) -> c_125() , #div^#(#neg(@x), #neg(@y)) -> c_126(#positive^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) , #div^#(#neg(@x), #pos(@y)) -> c_127(#negative^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) , #div^#(#pos(@x), #0()) -> c_128() , #div^#(#pos(@x), #neg(@y)) -> c_129(#negative^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) , #div^#(#pos(@x), #pos(@y)) -> c_130(#positive^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) , mult#1^#(nil(), @b2) -> c_43() , mult#3^#(#false(), @b2, @zs) -> c_45() , sub#1^#(tuple#2(@b, @_@1)) -> c_50() , sub'#1^#(nil(), @b2, @r) -> c_52() , sub'#2^#(nil(), @r, @x, @xs) -> c_54() , sub'#4^#(tuple#2(@zs, @s), @z) -> c_56(sub'#5^#(#equal(@s, #pos(#s(#0()))), @z, @zs), #equal^#(@s, #pos(#s(#0())))) , sub'#5^#(#false(), @z, @zs) -> c_57() , sub'#5^#(#true(), @z, @zs) -> c_58(#abs^#(#0())) , sum#2^#(#true(), @s) -> c_61(#abs^#(#0()), #abs^#(#0())) , sum#3^#(#false(), @s) -> c_62(sum#4^#(#equal(@s, #pos(#s(#s(#0()))))), #equal^#(@s, #pos(#s(#s(#0()))))) , sum#3^#(#true(), @s) -> c_63(#abs^#(#pos(#s(#0()))), #abs^#(#0())) , sum#4^#(#false()) -> c_64(#abs^#(#pos(#s(#0()))), #abs^#(#pos(#s(#0())))) , sum#4^#(#true()) -> c_65(#abs^#(#0()), #abs^#(#pos(#s(#0())))) , #and^#(#false(), #false()) -> c_139() , #and^#(#false(), #true()) -> c_140() , #and^#(#true(), #false()) -> c_141() , #and^#(#true(), #true()) -> c_142() , #natmult^#(#0(), @y) -> c_159() , #natmult^#(#s(@x), @y) -> c_160(#natadd^#(@y, #natmult(@x, @y)), #natmult^#(@x, @y)) , #pred^#(#0()) -> c_131() , #pred^#(#neg(#s(@x))) -> c_132() , #pred^#(#pos(#s(#0()))) -> c_133() , #pred^#(#pos(#s(#s(@x)))) -> c_134() , #succ^#(#0()) -> c_135() , #succ^#(#neg(#s(#0()))) -> c_136() , #succ^#(#neg(#s(#s(@x)))) -> c_137() , #succ^#(#pos(#s(@x))) -> c_138() , #positive^#(#0()) -> c_147() , #positive^#(#neg(@x)) -> c_148() , #positive^#(#pos(@x)) -> c_149() , #positive^#(#s(@x)) -> c_150() , #natdiv^#(#0(), #0()) -> c_143() , #natdiv^#(#0(), #s(@y)) -> c_144() , #natdiv^#(#s(@x), #0()) -> c_145() , #natdiv^#(#s(@x), #s(@y)) -> c_146(#natdiv'^#(#divsub(@x, @y), #s(@y)), #divsub^#(@x, @y)) , #negative^#(#0()) -> c_151() , #negative^#(#neg(@x)) -> c_152() , #negative^#(#pos(@x)) -> c_153() , #negative^#(#s(@x)) -> c_154() , #natdiv'^#(#0(), @y) -> c_163() , #natdiv'^#(#s(@x), @y) -> c_164(#natdiv^#(#s(@x), @y)) , #natdiv'^#(#underflow(), @y) -> c_165() , #divsub^#(#0(), #0()) -> c_155() , #divsub^#(#0(), #s(@y)) -> c_156() , #divsub^#(#s(@x), #0()) -> c_157() , #divsub^#(#s(@x), #s(@y)) -> c_158(#divsub^#(@x, @y)) , #natadd^#(#0(), @y) -> c_161() , #natadd^#(#s(@x), @y) -> c_162(#natadd^#(@x, @y)) , #natsub^#(@x, #0()) -> c_166() , #natsub^#(#s(@x), #s(@y)) -> c_167(#natsub^#(@x, @y)) } Weak Trs: { #abs(#0()) -> #0() , #abs(#neg(@x)) -> #pos(@x) , #abs(#pos(@x)) -> #pos(@x) , #abs(#s(@x)) -> #pos(#s(@x)) , #equal(@x, @y) -> #eq(@x, @y) , #eq(#0(), #0()) -> #true() , #eq(#0(), #neg(@y)) -> #false() , #eq(#0(), #pos(@y)) -> #false() , #eq(#0(), #s(@y)) -> #false() , #eq(#neg(@x), #0()) -> #false() , #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #pos(@y)) -> #false() , #eq(#pos(@x), #0()) -> #false() , #eq(#pos(@x), #neg(@y)) -> #false() , #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y) , #eq(#s(@x), #0()) -> #false() , #eq(#s(@x), #s(@y)) -> #eq(@x, @y) , #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #eq(::(@x_1, @x_2), nil()) -> #false() , #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false() , #eq(nil(), ::(@y_1, @y_2)) -> #false() , #eq(nil(), nil()) -> #true() , #eq(nil(), tuple#2(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), nil()) -> #false() , #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #greater(@x, @y) -> #ckgt(#compare(@x, @y)) , #compare(#0(), #0()) -> #EQ() , #compare(#0(), #neg(@y)) -> #GT() , #compare(#0(), #pos(@y)) -> #LT() , #compare(#0(), #s(@y)) -> #LT() , #compare(#neg(@x), #0()) -> #LT() , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x) , #compare(#neg(@x), #pos(@y)) -> #LT() , #compare(#pos(@x), #0()) -> #GT() , #compare(#pos(@x), #neg(@y)) -> #GT() , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y) , #compare(#s(@x), #0()) -> #GT() , #compare(#s(@x), #s(@y)) -> #compare(@x, @y) , #ckgt(#EQ()) -> #false() , #ckgt(#GT()) -> #true() , #ckgt(#LT()) -> #false() , #less(@x, @y) -> #cklt(#compare(@x, @y)) , #cklt(#EQ()) -> #false() , #cklt(#GT()) -> #false() , #cklt(#LT()) -> #true() , *(@x, @y) -> #mult(@x, @y) , #mult(#0(), #0()) -> #0() , #mult(#0(), #neg(@y)) -> #0() , #mult(#0(), #pos(@y)) -> #0() , #mult(#neg(@x), #0()) -> #0() , #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y)) , #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #0()) -> #0() , #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y)) , +(@x, @y) -> #add(@x, @y) , #add(#0(), @y) -> @y , #add(#neg(#s(#0())), @y) -> #pred(@y) , #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y)) , #add(#pos(#s(#0())), @y) -> #succ(@y) , #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y)) , -(@x, @y) -> #sub(@x, @y) , #sub(@x, #0()) -> @x , #sub(@x, #neg(@y)) -> #add(@x, #pos(@y)) , #sub(@x, #pos(@y)) -> #add(@x, #neg(@y)) , add(@b1, @b2) -> add'(@b1, @b2, #abs(#0())) , add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r) , add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs) , add'#1(nil(), @b2, @r) -> nil() , add'#2(::(@y, @ys), @r, @x, @xs) -> add'#3(sum(@x, @y, @r), @xs, @ys) , add'#2(nil(), @r, @x, @xs) -> nil() , sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r)) , add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r')) , bitToInt(@b) -> bitToInt'(@b, #abs(#pos(#s(#0())))) , bitToInt'(@b, @n) -> bitToInt'#1(@b, @n) , bitToInt'#1(::(@x, @xs), @n) -> +(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))) , bitToInt'#1(nil(), @n) -> #abs(#0()) , compare(@b1, @b2) -> compare#1(@b1, @b2) , compare#1(::(@x, @xs), @b2) -> compare#2(@b2, @x, @xs) , compare#1(nil(), @b2) -> #abs(#0()) , compare#2(::(@y, @ys), @x, @xs) -> compare#3(compare(@xs, @ys), @x, @y) , compare#2(nil(), @x, @xs) -> #abs(#0()) , compare#3(@r, @x, @y) -> compare#4(#equal(@r, #0()), @r, @x, @y) , compare#4(#false(), @r, @x, @y) -> @r , compare#4(#true(), @r, @x, @y) -> compare#5(#less(@x, @y), @x, @y) , compare#5(#false(), @x, @y) -> compare#6(#greater(@x, @y)) , compare#5(#true(), @x, @y) -> -(#0(), #pos(#s(#0()))) , compare#6(#false()) -> #abs(#0()) , compare#6(#true()) -> #abs(#pos(#s(#0()))) , diff(@x, @y, @r) -> tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))), diff#1(#less(-(-(@x, @y), @r), #0()))) , mod(@x, @y) -> -(@x, *(@y, div(@x, @y))) , diff#1(#false()) -> #abs(#0()) , diff#1(#true()) -> #abs(#pos(#s(#0()))) , div(@x, @y) -> #div(@x, @y) , #div(#0(), #0()) -> #divByZero() , #div(#0(), #neg(@y)) -> #0() , #div(#0(), #pos(@y)) -> #0() , #div(#neg(@x), #0()) -> #divByZero() , #div(#neg(@x), #neg(@y)) -> #positive(#natdiv(@x, @y)) , #div(#neg(@x), #pos(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #0()) -> #divByZero() , #div(#pos(@x), #neg(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #pos(@y)) -> #positive(#natdiv(@x, @y)) , leq(@b1, @b2) -> #less(compare(@b1, @b2), #pos(#s(#0()))) , mult(@b1, @b2) -> mult#1(@b1, @b2) , mult#1(::(@x, @xs), @b2) -> mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x) , mult#1(nil(), @b2) -> nil() , mult#2(@zs, @b2, @x) -> mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs) , mult#3(#false(), @b2, @zs) -> @zs , mult#3(#true(), @b2, @zs) -> add(@b2, @zs) , mult3(@b1, @b2, @b3) -> mult(mult(@b1, @b2), @b2) , sub(@b1, @b2) -> sub#1(sub'(@b1, @b2, #abs(#0()))) , sub'(@b1, @b2, @r) -> sub'#1(@b1, @b2, @r) , sub#1(tuple#2(@b, @_@1)) -> @b , sub'#1(::(@x, @xs), @b2, @r) -> sub'#2(@b2, @r, @x, @xs) , sub'#1(nil(), @b2, @r) -> tuple#2(nil(), @r) , sub'#2(::(@y, @ys), @r, @x, @xs) -> sub'#3(diff(@x, @y, @r), @xs, @ys) , sub'#2(nil(), @r, @x, @xs) -> tuple#2(nil(), @r) , sub'#3(tuple#2(@z, @r'), @xs, @ys) -> sub'#4(sub'(@xs, @ys, @r'), @z) , sub'#4(tuple#2(@zs, @s), @z) -> tuple#2(sub'#5(#equal(@s, #pos(#s(#0()))), @z, @zs), @s) , sub'#5(#false(), @z, @zs) -> ::(@z, @zs) , sub'#5(#true(), @z, @zs) -> ::(#abs(#0()), @zs) , sum#1(@s) -> sum#2(#equal(@s, #0()), @s) , sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s) , sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0())) , sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0()))))) , sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0())) , sum#4(#false()) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0())))) , sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0())))) , #pred(#0()) -> #neg(#s(#0())) , #pred(#neg(#s(@x))) -> #neg(#s(#s(@x))) , #pred(#pos(#s(#0()))) -> #0() , #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x)) , #succ(#0()) -> #pos(#s(#0())) , #succ(#neg(#s(#0()))) -> #0() , #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x)) , #succ(#pos(#s(@x))) -> #pos(#s(#s(@x))) , #and(#false(), #false()) -> #false() , #and(#false(), #true()) -> #false() , #and(#true(), #false()) -> #false() , #and(#true(), #true()) -> #true() , #natdiv(#0(), #0()) -> #divByZero() , #natdiv(#0(), #s(@y)) -> #0() , #natdiv(#s(@x), #0()) -> #divByZero() , #natdiv(#s(@x), #s(@y)) -> #natdiv'(#divsub(@x, @y), #s(@y)) , #positive(#0()) -> #0() , #positive(#neg(@x)) -> #neg(@x) , #positive(#pos(@x)) -> #pos(@x) , #positive(#s(@x)) -> #pos(#s(@x)) , #negative(#0()) -> #0() , #negative(#neg(@x)) -> #pos(@x) , #negative(#pos(@x)) -> #neg(@x) , #negative(#s(@x)) -> #neg(#s(@x)) , #divsub(#0(), #0()) -> #0() , #divsub(#0(), #s(@y)) -> #underflow() , #divsub(#s(@x), #0()) -> #s(@x) , #divsub(#s(@x), #s(@y)) -> #divsub(@x, @y) , #natmult(#0(), @y) -> #0() , #natmult(#s(@x), @y) -> #natadd(@y, #natmult(@x, @y)) , #natadd(#0(), @y) -> @y , #natadd(#s(@x), @y) -> #s(#natadd(@x, @y)) , #natdiv'(#0(), @y) -> #s(#0()) , #natdiv'(#s(@x), @y) -> #s(#natdiv(#s(@x), @y)) , #natdiv'(#underflow(), @y) -> #0() , #natsub(@x, #0()) -> @x , #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^2)) We estimate the number of application of {15,27} by applications of Pre({15,27}) = {7,14}. Here rules are labeled as follows: DPs: { 1: add^#(@b1, @b2) -> c_11(add'^#(@b1, @b2, #abs(#0())), #abs^#(#0())) , 2: add'^#(@b1, @b2, @r) -> c_12(add'#1^#(@b1, @b2, @r)) , 3: add'#1^#(::(@x, @xs), @b2, @r) -> c_13(add'#2^#(@b2, @r, @x, @xs)) , 4: add'#2^#(::(@y, @ys), @r, @x, @xs) -> c_15(add'#3^#(sum(@x, @y, @r), @xs, @ys), sum^#(@x, @y, @r)) , 5: add'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_18(add'^#(@xs, @ys, @r')) , 6: sum^#(@x, @y, @r) -> c_17(sum#1^#(+(+(@x, @y), @r)), +^#(+(@x, @y), @r), +^#(@x, @y)) , 7: sum#1^#(@s) -> c_59(sum#2^#(#equal(@s, #0()), @s), #equal^#(@s, #0())) , 8: bitToInt^#(@b) -> c_19(bitToInt'^#(@b, #abs(#pos(#s(#0())))), #abs^#(#pos(#s(#0())))) , 9: bitToInt'^#(@b, @n) -> c_20(bitToInt'#1^#(@b, @n)) , 10: bitToInt'#1^#(::(@x, @xs), @n) -> c_21(+^#(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))), *^#(@x, @n), bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))), *^#(@n, #pos(#s(#s(#0()))))) , 11: compare^#(@b1, @b2) -> c_23(compare#1^#(@b1, @b2)) , 12: compare#1^#(::(@x, @xs), @b2) -> c_24(compare#2^#(@b2, @x, @xs)) , 13: compare#2^#(::(@y, @ys), @x, @xs) -> c_26(compare#3^#(compare(@xs, @ys), @x, @y), compare^#(@xs, @ys)) , 14: compare#3^#(@r, @x, @y) -> c_28(compare#4^#(#equal(@r, #0()), @r, @x, @y), #equal^#(@r, #0())) , 15: compare#4^#(#true(), @r, @x, @y) -> c_30(compare#5^#(#less(@x, @y), @x, @y), #less^#(@x, @y)) , 16: leq^#(@b1, @b2) -> c_40(#less^#(compare(@b1, @b2), #pos(#s(#0()))), compare^#(@b1, @b2)) , 17: mult^#(@b1, @b2) -> c_41(mult#1^#(@b1, @b2)) , 18: mult#1^#(::(@x, @xs), @b2) -> c_42(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x), #abs^#(#0()), mult^#(@xs, @b2)) , 19: mult#2^#(@zs, @b2, @x) -> c_44(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs), #equal^#(@x, #pos(#s(#0())))) , 20: mult#3^#(#true(), @b2, @zs) -> c_46(add^#(@b2, @zs)) , 21: mult3^#(@b1, @b2, @b3) -> c_47(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2)) , 22: sub^#(@b1, @b2) -> c_48(sub#1^#(sub'(@b1, @b2, #abs(#0()))), sub'^#(@b1, @b2, #abs(#0())), #abs^#(#0())) , 23: sub'^#(@b1, @b2, @r) -> c_49(sub'#1^#(@b1, @b2, @r)) , 24: sub'#1^#(::(@x, @xs), @b2, @r) -> c_51(sub'#2^#(@b2, @r, @x, @xs)) , 25: sub'#2^#(::(@y, @ys), @r, @x, @xs) -> c_53(sub'#3^#(diff(@x, @y, @r), @xs, @ys), diff^#(@x, @y, @r)) , 26: sub'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_55(sub'#4^#(sub'(@xs, @ys, @r'), @z), sub'^#(@xs, @ys, @r')) , 27: sum#2^#(#false(), @s) -> c_60(sum#3^#(#equal(@s, #pos(#s(#0()))), @s), #equal^#(@s, #pos(#s(#0())))) , 28: #abs^#(#0()) -> c_1() , 29: #abs^#(#pos(@x)) -> c_3() , 30: #equal^#(@x, @y) -> c_5(#eq^#(@x, @y)) , 31: #eq^#(#0(), #0()) -> c_66() , 32: #eq^#(#0(), #neg(@y)) -> c_67() , 33: #eq^#(#0(), #pos(@y)) -> c_68() , 34: #eq^#(#0(), #s(@y)) -> c_69() , 35: #eq^#(#neg(@x), #0()) -> c_70() , 36: #eq^#(#neg(@x), #neg(@y)) -> c_71(#eq^#(@x, @y)) , 37: #eq^#(#neg(@x), #pos(@y)) -> c_72() , 38: #eq^#(#pos(@x), #0()) -> c_73() , 39: #eq^#(#pos(@x), #neg(@y)) -> c_74() , 40: #eq^#(#pos(@x), #pos(@y)) -> c_75(#eq^#(@x, @y)) , 41: #eq^#(#s(@x), #0()) -> c_76() , 42: #eq^#(#s(@x), #s(@y)) -> c_77(#eq^#(@x, @y)) , 43: #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) -> c_78(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)), #eq^#(@x_1, @y_1), #eq^#(@x_2, @y_2)) , 44: #eq^#(::(@x_1, @x_2), nil()) -> c_79() , 45: #eq^#(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> c_80() , 46: #eq^#(nil(), ::(@y_1, @y_2)) -> c_81() , 47: #eq^#(nil(), nil()) -> c_82() , 48: #eq^#(nil(), tuple#2(@y_1, @y_2)) -> c_83() , 49: #eq^#(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> c_84() , 50: #eq^#(tuple#2(@x_1, @x_2), nil()) -> c_85() , 51: #eq^#(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> c_86(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)), #eq^#(@x_1, @y_1), #eq^#(@x_2, @y_2)) , 52: #greater^#(@x, @y) -> c_6(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y)) , 53: #ckgt^#(#EQ()) -> c_99() , 54: #ckgt^#(#GT()) -> c_100() , 55: #ckgt^#(#LT()) -> c_101() , 56: #compare^#(#0(), #0()) -> c_87() , 57: #compare^#(#0(), #neg(@y)) -> c_88() , 58: #compare^#(#0(), #pos(@y)) -> c_89() , 59: #compare^#(#0(), #s(@y)) -> c_90() , 60: #compare^#(#neg(@x), #0()) -> c_91() , 61: #compare^#(#neg(@x), #neg(@y)) -> c_92(#compare^#(@y, @x)) , 62: #compare^#(#neg(@x), #pos(@y)) -> c_93() , 63: #compare^#(#pos(@x), #0()) -> c_94() , 64: #compare^#(#pos(@x), #neg(@y)) -> c_95() , 65: #compare^#(#pos(@x), #pos(@y)) -> c_96(#compare^#(@x, @y)) , 66: #compare^#(#s(@x), #0()) -> c_97() , 67: #compare^#(#s(@x), #s(@y)) -> c_98(#compare^#(@x, @y)) , 68: #less^#(@x, @y) -> c_7(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y)) , 69: #cklt^#(#EQ()) -> c_102() , 70: #cklt^#(#GT()) -> c_103() , 71: #cklt^#(#LT()) -> c_104() , 72: *^#(@x, @y) -> c_8(#mult^#(@x, @y)) , 73: #mult^#(#0(), #0()) -> c_105() , 74: #mult^#(#0(), #neg(@y)) -> c_106() , 75: #mult^#(#0(), #pos(@y)) -> c_107() , 76: #mult^#(#neg(@x), #0()) -> c_108() , 77: #mult^#(#neg(@x), #neg(@y)) -> c_109(#natmult^#(@x, @y)) , 78: #mult^#(#neg(@x), #pos(@y)) -> c_110(#natmult^#(@x, @y)) , 79: #mult^#(#pos(@x), #0()) -> c_111() , 80: #mult^#(#pos(@x), #neg(@y)) -> c_112(#natmult^#(@x, @y)) , 81: #mult^#(#pos(@x), #pos(@y)) -> c_113(#natmult^#(@x, @y)) , 82: +^#(@x, @y) -> c_9(#add^#(@x, @y)) , 83: #add^#(#0(), @y) -> c_114() , 84: #add^#(#neg(#s(#0())), @y) -> c_115(#pred^#(@y)) , 85: #add^#(#neg(#s(#s(@x))), @y) -> c_116(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) , 86: #add^#(#pos(#s(#0())), @y) -> c_117(#succ^#(@y)) , 87: #add^#(#pos(#s(#s(@x))), @y) -> c_118(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) , 88: -^#(@x, @y) -> c_10(#sub^#(@x, @y)) , 89: #sub^#(@x, #0()) -> c_119() , 90: #sub^#(@x, #neg(@y)) -> c_120(#add^#(@x, #pos(@y))) , 91: #sub^#(@x, #pos(@y)) -> c_121(#add^#(@x, #neg(@y))) , 92: add'#1^#(nil(), @b2, @r) -> c_14() , 93: add'#2^#(nil(), @r, @x, @xs) -> c_16() , 94: bitToInt'#1^#(nil(), @n) -> c_22(#abs^#(#0())) , 95: compare#1^#(nil(), @b2) -> c_25(#abs^#(#0())) , 96: compare#2^#(nil(), @x, @xs) -> c_27(#abs^#(#0())) , 97: compare#4^#(#false(), @r, @x, @y) -> c_29() , 98: compare#5^#(#false(), @x, @y) -> c_31(compare#6^#(#greater(@x, @y)), #greater^#(@x, @y)) , 99: compare#5^#(#true(), @x, @y) -> c_32(-^#(#0(), #pos(#s(#0())))) , 100: compare#6^#(#false()) -> c_33(#abs^#(#0())) , 101: compare#6^#(#true()) -> c_34(#abs^#(#pos(#s(#0())))) , 102: diff^#(@x, @y, @r) -> c_35(mod^#(+(+(@x, @y), @r), #pos(#s(#s(#0())))), +^#(+(@x, @y), @r), +^#(@x, @y), diff#1^#(#less(-(-(@x, @y), @r), #0())), #less^#(-(-(@x, @y), @r), #0()), -^#(-(@x, @y), @r), -^#(@x, @y)) , 103: mod^#(@x, @y) -> c_36(-^#(@x, *(@y, div(@x, @y))), *^#(@y, div(@x, @y)), div^#(@x, @y)) , 104: diff#1^#(#false()) -> c_37(#abs^#(#0())) , 105: diff#1^#(#true()) -> c_38(#abs^#(#pos(#s(#0())))) , 106: div^#(@x, @y) -> c_39(#div^#(@x, @y)) , 107: #div^#(#0(), #0()) -> c_122() , 108: #div^#(#0(), #neg(@y)) -> c_123() , 109: #div^#(#0(), #pos(@y)) -> c_124() , 110: #div^#(#neg(@x), #0()) -> c_125() , 111: #div^#(#neg(@x), #neg(@y)) -> c_126(#positive^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) , 112: #div^#(#neg(@x), #pos(@y)) -> c_127(#negative^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) , 113: #div^#(#pos(@x), #0()) -> c_128() , 114: #div^#(#pos(@x), #neg(@y)) -> c_129(#negative^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) , 115: #div^#(#pos(@x), #pos(@y)) -> c_130(#positive^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) , 116: mult#1^#(nil(), @b2) -> c_43() , 117: mult#3^#(#false(), @b2, @zs) -> c_45() , 118: sub#1^#(tuple#2(@b, @_@1)) -> c_50() , 119: sub'#1^#(nil(), @b2, @r) -> c_52() , 120: sub'#2^#(nil(), @r, @x, @xs) -> c_54() , 121: sub'#4^#(tuple#2(@zs, @s), @z) -> c_56(sub'#5^#(#equal(@s, #pos(#s(#0()))), @z, @zs), #equal^#(@s, #pos(#s(#0())))) , 122: sub'#5^#(#false(), @z, @zs) -> c_57() , 123: sub'#5^#(#true(), @z, @zs) -> c_58(#abs^#(#0())) , 124: sum#2^#(#true(), @s) -> c_61(#abs^#(#0()), #abs^#(#0())) , 125: sum#3^#(#false(), @s) -> c_62(sum#4^#(#equal(@s, #pos(#s(#s(#0()))))), #equal^#(@s, #pos(#s(#s(#0()))))) , 126: sum#3^#(#true(), @s) -> c_63(#abs^#(#pos(#s(#0()))), #abs^#(#0())) , 127: sum#4^#(#false()) -> c_64(#abs^#(#pos(#s(#0()))), #abs^#(#pos(#s(#0())))) , 128: sum#4^#(#true()) -> c_65(#abs^#(#0()), #abs^#(#pos(#s(#0())))) , 129: #and^#(#false(), #false()) -> c_139() , 130: #and^#(#false(), #true()) -> c_140() , 131: #and^#(#true(), #false()) -> c_141() , 132: #and^#(#true(), #true()) -> c_142() , 133: #natmult^#(#0(), @y) -> c_159() , 134: #natmult^#(#s(@x), @y) -> c_160(#natadd^#(@y, #natmult(@x, @y)), #natmult^#(@x, @y)) , 135: #pred^#(#0()) -> c_131() , 136: #pred^#(#neg(#s(@x))) -> c_132() , 137: #pred^#(#pos(#s(#0()))) -> c_133() , 138: #pred^#(#pos(#s(#s(@x)))) -> c_134() , 139: #succ^#(#0()) -> c_135() , 140: #succ^#(#neg(#s(#0()))) -> c_136() , 141: #succ^#(#neg(#s(#s(@x)))) -> c_137() , 142: #succ^#(#pos(#s(@x))) -> c_138() , 143: #positive^#(#0()) -> c_147() , 144: #positive^#(#neg(@x)) -> c_148() , 145: #positive^#(#pos(@x)) -> c_149() , 146: #positive^#(#s(@x)) -> c_150() , 147: #natdiv^#(#0(), #0()) -> c_143() , 148: #natdiv^#(#0(), #s(@y)) -> c_144() , 149: #natdiv^#(#s(@x), #0()) -> c_145() , 150: #natdiv^#(#s(@x), #s(@y)) -> c_146(#natdiv'^#(#divsub(@x, @y), #s(@y)), #divsub^#(@x, @y)) , 151: #negative^#(#0()) -> c_151() , 152: #negative^#(#neg(@x)) -> c_152() , 153: #negative^#(#pos(@x)) -> c_153() , 154: #negative^#(#s(@x)) -> c_154() , 155: #natdiv'^#(#0(), @y) -> c_163() , 156: #natdiv'^#(#s(@x), @y) -> c_164(#natdiv^#(#s(@x), @y)) , 157: #natdiv'^#(#underflow(), @y) -> c_165() , 158: #divsub^#(#0(), #0()) -> c_155() , 159: #divsub^#(#0(), #s(@y)) -> c_156() , 160: #divsub^#(#s(@x), #0()) -> c_157() , 161: #divsub^#(#s(@x), #s(@y)) -> c_158(#divsub^#(@x, @y)) , 162: #natadd^#(#0(), @y) -> c_161() , 163: #natadd^#(#s(@x), @y) -> c_162(#natadd^#(@x, @y)) , 164: #natsub^#(@x, #0()) -> c_166() , 165: #natsub^#(#s(@x), #s(@y)) -> c_167(#natsub^#(@x, @y)) } We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^2)). Strict DPs: { add^#(@b1, @b2) -> c_11(add'^#(@b1, @b2, #abs(#0())), #abs^#(#0())) , add'^#(@b1, @b2, @r) -> c_12(add'#1^#(@b1, @b2, @r)) , add'#1^#(::(@x, @xs), @b2, @r) -> c_13(add'#2^#(@b2, @r, @x, @xs)) , add'#2^#(::(@y, @ys), @r, @x, @xs) -> c_15(add'#3^#(sum(@x, @y, @r), @xs, @ys), sum^#(@x, @y, @r)) , add'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_18(add'^#(@xs, @ys, @r')) , sum^#(@x, @y, @r) -> c_17(sum#1^#(+(+(@x, @y), @r)), +^#(+(@x, @y), @r), +^#(@x, @y)) , sum#1^#(@s) -> c_59(sum#2^#(#equal(@s, #0()), @s), #equal^#(@s, #0())) , bitToInt^#(@b) -> c_19(bitToInt'^#(@b, #abs(#pos(#s(#0())))), #abs^#(#pos(#s(#0())))) , bitToInt'^#(@b, @n) -> c_20(bitToInt'#1^#(@b, @n)) , bitToInt'#1^#(::(@x, @xs), @n) -> c_21(+^#(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))), *^#(@x, @n), bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))), *^#(@n, #pos(#s(#s(#0()))))) , compare^#(@b1, @b2) -> c_23(compare#1^#(@b1, @b2)) , compare#1^#(::(@x, @xs), @b2) -> c_24(compare#2^#(@b2, @x, @xs)) , compare#2^#(::(@y, @ys), @x, @xs) -> c_26(compare#3^#(compare(@xs, @ys), @x, @y), compare^#(@xs, @ys)) , compare#3^#(@r, @x, @y) -> c_28(compare#4^#(#equal(@r, #0()), @r, @x, @y), #equal^#(@r, #0())) , leq^#(@b1, @b2) -> c_40(#less^#(compare(@b1, @b2), #pos(#s(#0()))), compare^#(@b1, @b2)) , mult^#(@b1, @b2) -> c_41(mult#1^#(@b1, @b2)) , mult#1^#(::(@x, @xs), @b2) -> c_42(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x), #abs^#(#0()), mult^#(@xs, @b2)) , mult#2^#(@zs, @b2, @x) -> c_44(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs), #equal^#(@x, #pos(#s(#0())))) , mult#3^#(#true(), @b2, @zs) -> c_46(add^#(@b2, @zs)) , mult3^#(@b1, @b2, @b3) -> c_47(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2)) , sub^#(@b1, @b2) -> c_48(sub#1^#(sub'(@b1, @b2, #abs(#0()))), sub'^#(@b1, @b2, #abs(#0())), #abs^#(#0())) , sub'^#(@b1, @b2, @r) -> c_49(sub'#1^#(@b1, @b2, @r)) , sub'#1^#(::(@x, @xs), @b2, @r) -> c_51(sub'#2^#(@b2, @r, @x, @xs)) , sub'#2^#(::(@y, @ys), @r, @x, @xs) -> c_53(sub'#3^#(diff(@x, @y, @r), @xs, @ys), diff^#(@x, @y, @r)) , sub'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_55(sub'#4^#(sub'(@xs, @ys, @r'), @z), sub'^#(@xs, @ys, @r')) } Weak DPs: { #abs^#(#0()) -> c_1() , #abs^#(#pos(@x)) -> c_3() , #equal^#(@x, @y) -> c_5(#eq^#(@x, @y)) , #eq^#(#0(), #0()) -> c_66() , #eq^#(#0(), #neg(@y)) -> c_67() , #eq^#(#0(), #pos(@y)) -> c_68() , #eq^#(#0(), #s(@y)) -> c_69() , #eq^#(#neg(@x), #0()) -> c_70() , #eq^#(#neg(@x), #neg(@y)) -> c_71(#eq^#(@x, @y)) , #eq^#(#neg(@x), #pos(@y)) -> c_72() , #eq^#(#pos(@x), #0()) -> c_73() , #eq^#(#pos(@x), #neg(@y)) -> c_74() , #eq^#(#pos(@x), #pos(@y)) -> c_75(#eq^#(@x, @y)) , #eq^#(#s(@x), #0()) -> c_76() , #eq^#(#s(@x), #s(@y)) -> c_77(#eq^#(@x, @y)) , #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) -> c_78(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)), #eq^#(@x_1, @y_1), #eq^#(@x_2, @y_2)) , #eq^#(::(@x_1, @x_2), nil()) -> c_79() , #eq^#(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> c_80() , #eq^#(nil(), ::(@y_1, @y_2)) -> c_81() , #eq^#(nil(), nil()) -> c_82() , #eq^#(nil(), tuple#2(@y_1, @y_2)) -> c_83() , #eq^#(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> c_84() , #eq^#(tuple#2(@x_1, @x_2), nil()) -> c_85() , #eq^#(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> c_86(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)), #eq^#(@x_1, @y_1), #eq^#(@x_2, @y_2)) , #greater^#(@x, @y) -> c_6(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y)) , #ckgt^#(#EQ()) -> c_99() , #ckgt^#(#GT()) -> c_100() , #ckgt^#(#LT()) -> c_101() , #compare^#(#0(), #0()) -> c_87() , #compare^#(#0(), #neg(@y)) -> c_88() , #compare^#(#0(), #pos(@y)) -> c_89() , #compare^#(#0(), #s(@y)) -> c_90() , #compare^#(#neg(@x), #0()) -> c_91() , #compare^#(#neg(@x), #neg(@y)) -> c_92(#compare^#(@y, @x)) , #compare^#(#neg(@x), #pos(@y)) -> c_93() , #compare^#(#pos(@x), #0()) -> c_94() , #compare^#(#pos(@x), #neg(@y)) -> c_95() , #compare^#(#pos(@x), #pos(@y)) -> c_96(#compare^#(@x, @y)) , #compare^#(#s(@x), #0()) -> c_97() , #compare^#(#s(@x), #s(@y)) -> c_98(#compare^#(@x, @y)) , #less^#(@x, @y) -> c_7(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y)) , #cklt^#(#EQ()) -> c_102() , #cklt^#(#GT()) -> c_103() , #cklt^#(#LT()) -> c_104() , *^#(@x, @y) -> c_8(#mult^#(@x, @y)) , #mult^#(#0(), #0()) -> c_105() , #mult^#(#0(), #neg(@y)) -> c_106() , #mult^#(#0(), #pos(@y)) -> c_107() , #mult^#(#neg(@x), #0()) -> c_108() , #mult^#(#neg(@x), #neg(@y)) -> c_109(#natmult^#(@x, @y)) , #mult^#(#neg(@x), #pos(@y)) -> c_110(#natmult^#(@x, @y)) , #mult^#(#pos(@x), #0()) -> c_111() , #mult^#(#pos(@x), #neg(@y)) -> c_112(#natmult^#(@x, @y)) , #mult^#(#pos(@x), #pos(@y)) -> c_113(#natmult^#(@x, @y)) , +^#(@x, @y) -> c_9(#add^#(@x, @y)) , #add^#(#0(), @y) -> c_114() , #add^#(#neg(#s(#0())), @y) -> c_115(#pred^#(@y)) , #add^#(#neg(#s(#s(@x))), @y) -> c_116(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) , #add^#(#pos(#s(#0())), @y) -> c_117(#succ^#(@y)) , #add^#(#pos(#s(#s(@x))), @y) -> c_118(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) , -^#(@x, @y) -> c_10(#sub^#(@x, @y)) , #sub^#(@x, #0()) -> c_119() , #sub^#(@x, #neg(@y)) -> c_120(#add^#(@x, #pos(@y))) , #sub^#(@x, #pos(@y)) -> c_121(#add^#(@x, #neg(@y))) , add'#1^#(nil(), @b2, @r) -> c_14() , add'#2^#(nil(), @r, @x, @xs) -> c_16() , bitToInt'#1^#(nil(), @n) -> c_22(#abs^#(#0())) , compare#1^#(nil(), @b2) -> c_25(#abs^#(#0())) , compare#2^#(nil(), @x, @xs) -> c_27(#abs^#(#0())) , compare#4^#(#false(), @r, @x, @y) -> c_29() , compare#4^#(#true(), @r, @x, @y) -> c_30(compare#5^#(#less(@x, @y), @x, @y), #less^#(@x, @y)) , compare#5^#(#false(), @x, @y) -> c_31(compare#6^#(#greater(@x, @y)), #greater^#(@x, @y)) , compare#5^#(#true(), @x, @y) -> c_32(-^#(#0(), #pos(#s(#0())))) , compare#6^#(#false()) -> c_33(#abs^#(#0())) , compare#6^#(#true()) -> c_34(#abs^#(#pos(#s(#0())))) , diff^#(@x, @y, @r) -> c_35(mod^#(+(+(@x, @y), @r), #pos(#s(#s(#0())))), +^#(+(@x, @y), @r), +^#(@x, @y), diff#1^#(#less(-(-(@x, @y), @r), #0())), #less^#(-(-(@x, @y), @r), #0()), -^#(-(@x, @y), @r), -^#(@x, @y)) , mod^#(@x, @y) -> c_36(-^#(@x, *(@y, div(@x, @y))), *^#(@y, div(@x, @y)), div^#(@x, @y)) , diff#1^#(#false()) -> c_37(#abs^#(#0())) , diff#1^#(#true()) -> c_38(#abs^#(#pos(#s(#0())))) , div^#(@x, @y) -> c_39(#div^#(@x, @y)) , #div^#(#0(), #0()) -> c_122() , #div^#(#0(), #neg(@y)) -> c_123() , #div^#(#0(), #pos(@y)) -> c_124() , #div^#(#neg(@x), #0()) -> c_125() , #div^#(#neg(@x), #neg(@y)) -> c_126(#positive^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) , #div^#(#neg(@x), #pos(@y)) -> c_127(#negative^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) , #div^#(#pos(@x), #0()) -> c_128() , #div^#(#pos(@x), #neg(@y)) -> c_129(#negative^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) , #div^#(#pos(@x), #pos(@y)) -> c_130(#positive^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) , mult#1^#(nil(), @b2) -> c_43() , mult#3^#(#false(), @b2, @zs) -> c_45() , sub#1^#(tuple#2(@b, @_@1)) -> c_50() , sub'#1^#(nil(), @b2, @r) -> c_52() , sub'#2^#(nil(), @r, @x, @xs) -> c_54() , sub'#4^#(tuple#2(@zs, @s), @z) -> c_56(sub'#5^#(#equal(@s, #pos(#s(#0()))), @z, @zs), #equal^#(@s, #pos(#s(#0())))) , sub'#5^#(#false(), @z, @zs) -> c_57() , sub'#5^#(#true(), @z, @zs) -> c_58(#abs^#(#0())) , sum#2^#(#false(), @s) -> c_60(sum#3^#(#equal(@s, #pos(#s(#0()))), @s), #equal^#(@s, #pos(#s(#0())))) , sum#2^#(#true(), @s) -> c_61(#abs^#(#0()), #abs^#(#0())) , sum#3^#(#false(), @s) -> c_62(sum#4^#(#equal(@s, #pos(#s(#s(#0()))))), #equal^#(@s, #pos(#s(#s(#0()))))) , sum#3^#(#true(), @s) -> c_63(#abs^#(#pos(#s(#0()))), #abs^#(#0())) , sum#4^#(#false()) -> c_64(#abs^#(#pos(#s(#0()))), #abs^#(#pos(#s(#0())))) , sum#4^#(#true()) -> c_65(#abs^#(#0()), #abs^#(#pos(#s(#0())))) , #and^#(#false(), #false()) -> c_139() , #and^#(#false(), #true()) -> c_140() , #and^#(#true(), #false()) -> c_141() , #and^#(#true(), #true()) -> c_142() , #natmult^#(#0(), @y) -> c_159() , #natmult^#(#s(@x), @y) -> c_160(#natadd^#(@y, #natmult(@x, @y)), #natmult^#(@x, @y)) , #pred^#(#0()) -> c_131() , #pred^#(#neg(#s(@x))) -> c_132() , #pred^#(#pos(#s(#0()))) -> c_133() , #pred^#(#pos(#s(#s(@x)))) -> c_134() , #succ^#(#0()) -> c_135() , #succ^#(#neg(#s(#0()))) -> c_136() , #succ^#(#neg(#s(#s(@x)))) -> c_137() , #succ^#(#pos(#s(@x))) -> c_138() , #positive^#(#0()) -> c_147() , #positive^#(#neg(@x)) -> c_148() , #positive^#(#pos(@x)) -> c_149() , #positive^#(#s(@x)) -> c_150() , #natdiv^#(#0(), #0()) -> c_143() , #natdiv^#(#0(), #s(@y)) -> c_144() , #natdiv^#(#s(@x), #0()) -> c_145() , #natdiv^#(#s(@x), #s(@y)) -> c_146(#natdiv'^#(#divsub(@x, @y), #s(@y)), #divsub^#(@x, @y)) , #negative^#(#0()) -> c_151() , #negative^#(#neg(@x)) -> c_152() , #negative^#(#pos(@x)) -> c_153() , #negative^#(#s(@x)) -> c_154() , #natdiv'^#(#0(), @y) -> c_163() , #natdiv'^#(#s(@x), @y) -> c_164(#natdiv^#(#s(@x), @y)) , #natdiv'^#(#underflow(), @y) -> c_165() , #divsub^#(#0(), #0()) -> c_155() , #divsub^#(#0(), #s(@y)) -> c_156() , #divsub^#(#s(@x), #0()) -> c_157() , #divsub^#(#s(@x), #s(@y)) -> c_158(#divsub^#(@x, @y)) , #natadd^#(#0(), @y) -> c_161() , #natadd^#(#s(@x), @y) -> c_162(#natadd^#(@x, @y)) , #natsub^#(@x, #0()) -> c_166() , #natsub^#(#s(@x), #s(@y)) -> c_167(#natsub^#(@x, @y)) } Weak Trs: { #abs(#0()) -> #0() , #abs(#neg(@x)) -> #pos(@x) , #abs(#pos(@x)) -> #pos(@x) , #abs(#s(@x)) -> #pos(#s(@x)) , #equal(@x, @y) -> #eq(@x, @y) , #eq(#0(), #0()) -> #true() , #eq(#0(), #neg(@y)) -> #false() , #eq(#0(), #pos(@y)) -> #false() , #eq(#0(), #s(@y)) -> #false() , #eq(#neg(@x), #0()) -> #false() , #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #pos(@y)) -> #false() , #eq(#pos(@x), #0()) -> #false() , #eq(#pos(@x), #neg(@y)) -> #false() , #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y) , #eq(#s(@x), #0()) -> #false() , #eq(#s(@x), #s(@y)) -> #eq(@x, @y) , #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #eq(::(@x_1, @x_2), nil()) -> #false() , #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false() , #eq(nil(), ::(@y_1, @y_2)) -> #false() , #eq(nil(), nil()) -> #true() , #eq(nil(), tuple#2(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), nil()) -> #false() , #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #greater(@x, @y) -> #ckgt(#compare(@x, @y)) , #compare(#0(), #0()) -> #EQ() , #compare(#0(), #neg(@y)) -> #GT() , #compare(#0(), #pos(@y)) -> #LT() , #compare(#0(), #s(@y)) -> #LT() , #compare(#neg(@x), #0()) -> #LT() , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x) , #compare(#neg(@x), #pos(@y)) -> #LT() , #compare(#pos(@x), #0()) -> #GT() , #compare(#pos(@x), #neg(@y)) -> #GT() , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y) , #compare(#s(@x), #0()) -> #GT() , #compare(#s(@x), #s(@y)) -> #compare(@x, @y) , #ckgt(#EQ()) -> #false() , #ckgt(#GT()) -> #true() , #ckgt(#LT()) -> #false() , #less(@x, @y) -> #cklt(#compare(@x, @y)) , #cklt(#EQ()) -> #false() , #cklt(#GT()) -> #false() , #cklt(#LT()) -> #true() , *(@x, @y) -> #mult(@x, @y) , #mult(#0(), #0()) -> #0() , #mult(#0(), #neg(@y)) -> #0() , #mult(#0(), #pos(@y)) -> #0() , #mult(#neg(@x), #0()) -> #0() , #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y)) , #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #0()) -> #0() , #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y)) , +(@x, @y) -> #add(@x, @y) , #add(#0(), @y) -> @y , #add(#neg(#s(#0())), @y) -> #pred(@y) , #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y)) , #add(#pos(#s(#0())), @y) -> #succ(@y) , #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y)) , -(@x, @y) -> #sub(@x, @y) , #sub(@x, #0()) -> @x , #sub(@x, #neg(@y)) -> #add(@x, #pos(@y)) , #sub(@x, #pos(@y)) -> #add(@x, #neg(@y)) , add(@b1, @b2) -> add'(@b1, @b2, #abs(#0())) , add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r) , add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs) , add'#1(nil(), @b2, @r) -> nil() , add'#2(::(@y, @ys), @r, @x, @xs) -> add'#3(sum(@x, @y, @r), @xs, @ys) , add'#2(nil(), @r, @x, @xs) -> nil() , sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r)) , add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r')) , bitToInt(@b) -> bitToInt'(@b, #abs(#pos(#s(#0())))) , bitToInt'(@b, @n) -> bitToInt'#1(@b, @n) , bitToInt'#1(::(@x, @xs), @n) -> +(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))) , bitToInt'#1(nil(), @n) -> #abs(#0()) , compare(@b1, @b2) -> compare#1(@b1, @b2) , compare#1(::(@x, @xs), @b2) -> compare#2(@b2, @x, @xs) , compare#1(nil(), @b2) -> #abs(#0()) , compare#2(::(@y, @ys), @x, @xs) -> compare#3(compare(@xs, @ys), @x, @y) , compare#2(nil(), @x, @xs) -> #abs(#0()) , compare#3(@r, @x, @y) -> compare#4(#equal(@r, #0()), @r, @x, @y) , compare#4(#false(), @r, @x, @y) -> @r , compare#4(#true(), @r, @x, @y) -> compare#5(#less(@x, @y), @x, @y) , compare#5(#false(), @x, @y) -> compare#6(#greater(@x, @y)) , compare#5(#true(), @x, @y) -> -(#0(), #pos(#s(#0()))) , compare#6(#false()) -> #abs(#0()) , compare#6(#true()) -> #abs(#pos(#s(#0()))) , diff(@x, @y, @r) -> tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))), diff#1(#less(-(-(@x, @y), @r), #0()))) , mod(@x, @y) -> -(@x, *(@y, div(@x, @y))) , diff#1(#false()) -> #abs(#0()) , diff#1(#true()) -> #abs(#pos(#s(#0()))) , div(@x, @y) -> #div(@x, @y) , #div(#0(), #0()) -> #divByZero() , #div(#0(), #neg(@y)) -> #0() , #div(#0(), #pos(@y)) -> #0() , #div(#neg(@x), #0()) -> #divByZero() , #div(#neg(@x), #neg(@y)) -> #positive(#natdiv(@x, @y)) , #div(#neg(@x), #pos(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #0()) -> #divByZero() , #div(#pos(@x), #neg(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #pos(@y)) -> #positive(#natdiv(@x, @y)) , leq(@b1, @b2) -> #less(compare(@b1, @b2), #pos(#s(#0()))) , mult(@b1, @b2) -> mult#1(@b1, @b2) , mult#1(::(@x, @xs), @b2) -> mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x) , mult#1(nil(), @b2) -> nil() , mult#2(@zs, @b2, @x) -> mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs) , mult#3(#false(), @b2, @zs) -> @zs , mult#3(#true(), @b2, @zs) -> add(@b2, @zs) , mult3(@b1, @b2, @b3) -> mult(mult(@b1, @b2), @b2) , sub(@b1, @b2) -> sub#1(sub'(@b1, @b2, #abs(#0()))) , sub'(@b1, @b2, @r) -> sub'#1(@b1, @b2, @r) , sub#1(tuple#2(@b, @_@1)) -> @b , sub'#1(::(@x, @xs), @b2, @r) -> sub'#2(@b2, @r, @x, @xs) , sub'#1(nil(), @b2, @r) -> tuple#2(nil(), @r) , sub'#2(::(@y, @ys), @r, @x, @xs) -> sub'#3(diff(@x, @y, @r), @xs, @ys) , sub'#2(nil(), @r, @x, @xs) -> tuple#2(nil(), @r) , sub'#3(tuple#2(@z, @r'), @xs, @ys) -> sub'#4(sub'(@xs, @ys, @r'), @z) , sub'#4(tuple#2(@zs, @s), @z) -> tuple#2(sub'#5(#equal(@s, #pos(#s(#0()))), @z, @zs), @s) , sub'#5(#false(), @z, @zs) -> ::(@z, @zs) , sub'#5(#true(), @z, @zs) -> ::(#abs(#0()), @zs) , sum#1(@s) -> sum#2(#equal(@s, #0()), @s) , sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s) , sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0())) , sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0()))))) , sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0())) , sum#4(#false()) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0())))) , sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0())))) , #pred(#0()) -> #neg(#s(#0())) , #pred(#neg(#s(@x))) -> #neg(#s(#s(@x))) , #pred(#pos(#s(#0()))) -> #0() , #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x)) , #succ(#0()) -> #pos(#s(#0())) , #succ(#neg(#s(#0()))) -> #0() , #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x)) , #succ(#pos(#s(@x))) -> #pos(#s(#s(@x))) , #and(#false(), #false()) -> #false() , #and(#false(), #true()) -> #false() , #and(#true(), #false()) -> #false() , #and(#true(), #true()) -> #true() , #natdiv(#0(), #0()) -> #divByZero() , #natdiv(#0(), #s(@y)) -> #0() , #natdiv(#s(@x), #0()) -> #divByZero() , #natdiv(#s(@x), #s(@y)) -> #natdiv'(#divsub(@x, @y), #s(@y)) , #positive(#0()) -> #0() , #positive(#neg(@x)) -> #neg(@x) , #positive(#pos(@x)) -> #pos(@x) , #positive(#s(@x)) -> #pos(#s(@x)) , #negative(#0()) -> #0() , #negative(#neg(@x)) -> #pos(@x) , #negative(#pos(@x)) -> #neg(@x) , #negative(#s(@x)) -> #neg(#s(@x)) , #divsub(#0(), #0()) -> #0() , #divsub(#0(), #s(@y)) -> #underflow() , #divsub(#s(@x), #0()) -> #s(@x) , #divsub(#s(@x), #s(@y)) -> #divsub(@x, @y) , #natmult(#0(), @y) -> #0() , #natmult(#s(@x), @y) -> #natadd(@y, #natmult(@x, @y)) , #natadd(#0(), @y) -> @y , #natadd(#s(@x), @y) -> #s(#natadd(@x, @y)) , #natdiv'(#0(), @y) -> #s(#0()) , #natdiv'(#s(@x), @y) -> #s(#natdiv(#s(@x), @y)) , #natdiv'(#underflow(), @y) -> #0() , #natsub(@x, #0()) -> @x , #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^2)) We estimate the number of application of {7,14} by applications of Pre({7,14}) = {6,13}. Here rules are labeled as follows: DPs: { 1: add^#(@b1, @b2) -> c_11(add'^#(@b1, @b2, #abs(#0())), #abs^#(#0())) , 2: add'^#(@b1, @b2, @r) -> c_12(add'#1^#(@b1, @b2, @r)) , 3: add'#1^#(::(@x, @xs), @b2, @r) -> c_13(add'#2^#(@b2, @r, @x, @xs)) , 4: add'#2^#(::(@y, @ys), @r, @x, @xs) -> c_15(add'#3^#(sum(@x, @y, @r), @xs, @ys), sum^#(@x, @y, @r)) , 5: add'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_18(add'^#(@xs, @ys, @r')) , 6: sum^#(@x, @y, @r) -> c_17(sum#1^#(+(+(@x, @y), @r)), +^#(+(@x, @y), @r), +^#(@x, @y)) , 7: sum#1^#(@s) -> c_59(sum#2^#(#equal(@s, #0()), @s), #equal^#(@s, #0())) , 8: bitToInt^#(@b) -> c_19(bitToInt'^#(@b, #abs(#pos(#s(#0())))), #abs^#(#pos(#s(#0())))) , 9: bitToInt'^#(@b, @n) -> c_20(bitToInt'#1^#(@b, @n)) , 10: bitToInt'#1^#(::(@x, @xs), @n) -> c_21(+^#(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))), *^#(@x, @n), bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))), *^#(@n, #pos(#s(#s(#0()))))) , 11: compare^#(@b1, @b2) -> c_23(compare#1^#(@b1, @b2)) , 12: compare#1^#(::(@x, @xs), @b2) -> c_24(compare#2^#(@b2, @x, @xs)) , 13: compare#2^#(::(@y, @ys), @x, @xs) -> c_26(compare#3^#(compare(@xs, @ys), @x, @y), compare^#(@xs, @ys)) , 14: compare#3^#(@r, @x, @y) -> c_28(compare#4^#(#equal(@r, #0()), @r, @x, @y), #equal^#(@r, #0())) , 15: leq^#(@b1, @b2) -> c_40(#less^#(compare(@b1, @b2), #pos(#s(#0()))), compare^#(@b1, @b2)) , 16: mult^#(@b1, @b2) -> c_41(mult#1^#(@b1, @b2)) , 17: mult#1^#(::(@x, @xs), @b2) -> c_42(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x), #abs^#(#0()), mult^#(@xs, @b2)) , 18: mult#2^#(@zs, @b2, @x) -> c_44(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs), #equal^#(@x, #pos(#s(#0())))) , 19: mult#3^#(#true(), @b2, @zs) -> c_46(add^#(@b2, @zs)) , 20: mult3^#(@b1, @b2, @b3) -> c_47(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2)) , 21: sub^#(@b1, @b2) -> c_48(sub#1^#(sub'(@b1, @b2, #abs(#0()))), sub'^#(@b1, @b2, #abs(#0())), #abs^#(#0())) , 22: sub'^#(@b1, @b2, @r) -> c_49(sub'#1^#(@b1, @b2, @r)) , 23: sub'#1^#(::(@x, @xs), @b2, @r) -> c_51(sub'#2^#(@b2, @r, @x, @xs)) , 24: sub'#2^#(::(@y, @ys), @r, @x, @xs) -> c_53(sub'#3^#(diff(@x, @y, @r), @xs, @ys), diff^#(@x, @y, @r)) , 25: sub'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_55(sub'#4^#(sub'(@xs, @ys, @r'), @z), sub'^#(@xs, @ys, @r')) , 26: #abs^#(#0()) -> c_1() , 27: #abs^#(#pos(@x)) -> c_3() , 28: #equal^#(@x, @y) -> c_5(#eq^#(@x, @y)) , 29: #eq^#(#0(), #0()) -> c_66() , 30: #eq^#(#0(), #neg(@y)) -> c_67() , 31: #eq^#(#0(), #pos(@y)) -> c_68() , 32: #eq^#(#0(), #s(@y)) -> c_69() , 33: #eq^#(#neg(@x), #0()) -> c_70() , 34: #eq^#(#neg(@x), #neg(@y)) -> c_71(#eq^#(@x, @y)) , 35: #eq^#(#neg(@x), #pos(@y)) -> c_72() , 36: #eq^#(#pos(@x), #0()) -> c_73() , 37: #eq^#(#pos(@x), #neg(@y)) -> c_74() , 38: #eq^#(#pos(@x), #pos(@y)) -> c_75(#eq^#(@x, @y)) , 39: #eq^#(#s(@x), #0()) -> c_76() , 40: #eq^#(#s(@x), #s(@y)) -> c_77(#eq^#(@x, @y)) , 41: #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) -> c_78(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)), #eq^#(@x_1, @y_1), #eq^#(@x_2, @y_2)) , 42: #eq^#(::(@x_1, @x_2), nil()) -> c_79() , 43: #eq^#(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> c_80() , 44: #eq^#(nil(), ::(@y_1, @y_2)) -> c_81() , 45: #eq^#(nil(), nil()) -> c_82() , 46: #eq^#(nil(), tuple#2(@y_1, @y_2)) -> c_83() , 47: #eq^#(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> c_84() , 48: #eq^#(tuple#2(@x_1, @x_2), nil()) -> c_85() , 49: #eq^#(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> c_86(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)), #eq^#(@x_1, @y_1), #eq^#(@x_2, @y_2)) , 50: #greater^#(@x, @y) -> c_6(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y)) , 51: #ckgt^#(#EQ()) -> c_99() , 52: #ckgt^#(#GT()) -> c_100() , 53: #ckgt^#(#LT()) -> c_101() , 54: #compare^#(#0(), #0()) -> c_87() , 55: #compare^#(#0(), #neg(@y)) -> c_88() , 56: #compare^#(#0(), #pos(@y)) -> c_89() , 57: #compare^#(#0(), #s(@y)) -> c_90() , 58: #compare^#(#neg(@x), #0()) -> c_91() , 59: #compare^#(#neg(@x), #neg(@y)) -> c_92(#compare^#(@y, @x)) , 60: #compare^#(#neg(@x), #pos(@y)) -> c_93() , 61: #compare^#(#pos(@x), #0()) -> c_94() , 62: #compare^#(#pos(@x), #neg(@y)) -> c_95() , 63: #compare^#(#pos(@x), #pos(@y)) -> c_96(#compare^#(@x, @y)) , 64: #compare^#(#s(@x), #0()) -> c_97() , 65: #compare^#(#s(@x), #s(@y)) -> c_98(#compare^#(@x, @y)) , 66: #less^#(@x, @y) -> c_7(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y)) , 67: #cklt^#(#EQ()) -> c_102() , 68: #cklt^#(#GT()) -> c_103() , 69: #cklt^#(#LT()) -> c_104() , 70: *^#(@x, @y) -> c_8(#mult^#(@x, @y)) , 71: #mult^#(#0(), #0()) -> c_105() , 72: #mult^#(#0(), #neg(@y)) -> c_106() , 73: #mult^#(#0(), #pos(@y)) -> c_107() , 74: #mult^#(#neg(@x), #0()) -> c_108() , 75: #mult^#(#neg(@x), #neg(@y)) -> c_109(#natmult^#(@x, @y)) , 76: #mult^#(#neg(@x), #pos(@y)) -> c_110(#natmult^#(@x, @y)) , 77: #mult^#(#pos(@x), #0()) -> c_111() , 78: #mult^#(#pos(@x), #neg(@y)) -> c_112(#natmult^#(@x, @y)) , 79: #mult^#(#pos(@x), #pos(@y)) -> c_113(#natmult^#(@x, @y)) , 80: +^#(@x, @y) -> c_9(#add^#(@x, @y)) , 81: #add^#(#0(), @y) -> c_114() , 82: #add^#(#neg(#s(#0())), @y) -> c_115(#pred^#(@y)) , 83: #add^#(#neg(#s(#s(@x))), @y) -> c_116(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) , 84: #add^#(#pos(#s(#0())), @y) -> c_117(#succ^#(@y)) , 85: #add^#(#pos(#s(#s(@x))), @y) -> c_118(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) , 86: -^#(@x, @y) -> c_10(#sub^#(@x, @y)) , 87: #sub^#(@x, #0()) -> c_119() , 88: #sub^#(@x, #neg(@y)) -> c_120(#add^#(@x, #pos(@y))) , 89: #sub^#(@x, #pos(@y)) -> c_121(#add^#(@x, #neg(@y))) , 90: add'#1^#(nil(), @b2, @r) -> c_14() , 91: add'#2^#(nil(), @r, @x, @xs) -> c_16() , 92: bitToInt'#1^#(nil(), @n) -> c_22(#abs^#(#0())) , 93: compare#1^#(nil(), @b2) -> c_25(#abs^#(#0())) , 94: compare#2^#(nil(), @x, @xs) -> c_27(#abs^#(#0())) , 95: compare#4^#(#false(), @r, @x, @y) -> c_29() , 96: compare#4^#(#true(), @r, @x, @y) -> c_30(compare#5^#(#less(@x, @y), @x, @y), #less^#(@x, @y)) , 97: compare#5^#(#false(), @x, @y) -> c_31(compare#6^#(#greater(@x, @y)), #greater^#(@x, @y)) , 98: compare#5^#(#true(), @x, @y) -> c_32(-^#(#0(), #pos(#s(#0())))) , 99: compare#6^#(#false()) -> c_33(#abs^#(#0())) , 100: compare#6^#(#true()) -> c_34(#abs^#(#pos(#s(#0())))) , 101: diff^#(@x, @y, @r) -> c_35(mod^#(+(+(@x, @y), @r), #pos(#s(#s(#0())))), +^#(+(@x, @y), @r), +^#(@x, @y), diff#1^#(#less(-(-(@x, @y), @r), #0())), #less^#(-(-(@x, @y), @r), #0()), -^#(-(@x, @y), @r), -^#(@x, @y)) , 102: mod^#(@x, @y) -> c_36(-^#(@x, *(@y, div(@x, @y))), *^#(@y, div(@x, @y)), div^#(@x, @y)) , 103: diff#1^#(#false()) -> c_37(#abs^#(#0())) , 104: diff#1^#(#true()) -> c_38(#abs^#(#pos(#s(#0())))) , 105: div^#(@x, @y) -> c_39(#div^#(@x, @y)) , 106: #div^#(#0(), #0()) -> c_122() , 107: #div^#(#0(), #neg(@y)) -> c_123() , 108: #div^#(#0(), #pos(@y)) -> c_124() , 109: #div^#(#neg(@x), #0()) -> c_125() , 110: #div^#(#neg(@x), #neg(@y)) -> c_126(#positive^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) , 111: #div^#(#neg(@x), #pos(@y)) -> c_127(#negative^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) , 112: #div^#(#pos(@x), #0()) -> c_128() , 113: #div^#(#pos(@x), #neg(@y)) -> c_129(#negative^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) , 114: #div^#(#pos(@x), #pos(@y)) -> c_130(#positive^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) , 115: mult#1^#(nil(), @b2) -> c_43() , 116: mult#3^#(#false(), @b2, @zs) -> c_45() , 117: sub#1^#(tuple#2(@b, @_@1)) -> c_50() , 118: sub'#1^#(nil(), @b2, @r) -> c_52() , 119: sub'#2^#(nil(), @r, @x, @xs) -> c_54() , 120: sub'#4^#(tuple#2(@zs, @s), @z) -> c_56(sub'#5^#(#equal(@s, #pos(#s(#0()))), @z, @zs), #equal^#(@s, #pos(#s(#0())))) , 121: sub'#5^#(#false(), @z, @zs) -> c_57() , 122: sub'#5^#(#true(), @z, @zs) -> c_58(#abs^#(#0())) , 123: sum#2^#(#false(), @s) -> c_60(sum#3^#(#equal(@s, #pos(#s(#0()))), @s), #equal^#(@s, #pos(#s(#0())))) , 124: sum#2^#(#true(), @s) -> c_61(#abs^#(#0()), #abs^#(#0())) , 125: sum#3^#(#false(), @s) -> c_62(sum#4^#(#equal(@s, #pos(#s(#s(#0()))))), #equal^#(@s, #pos(#s(#s(#0()))))) , 126: sum#3^#(#true(), @s) -> c_63(#abs^#(#pos(#s(#0()))), #abs^#(#0())) , 127: sum#4^#(#false()) -> c_64(#abs^#(#pos(#s(#0()))), #abs^#(#pos(#s(#0())))) , 128: sum#4^#(#true()) -> c_65(#abs^#(#0()), #abs^#(#pos(#s(#0())))) , 129: #and^#(#false(), #false()) -> c_139() , 130: #and^#(#false(), #true()) -> c_140() , 131: #and^#(#true(), #false()) -> c_141() , 132: #and^#(#true(), #true()) -> c_142() , 133: #natmult^#(#0(), @y) -> c_159() , 134: #natmult^#(#s(@x), @y) -> c_160(#natadd^#(@y, #natmult(@x, @y)), #natmult^#(@x, @y)) , 135: #pred^#(#0()) -> c_131() , 136: #pred^#(#neg(#s(@x))) -> c_132() , 137: #pred^#(#pos(#s(#0()))) -> c_133() , 138: #pred^#(#pos(#s(#s(@x)))) -> c_134() , 139: #succ^#(#0()) -> c_135() , 140: #succ^#(#neg(#s(#0()))) -> c_136() , 141: #succ^#(#neg(#s(#s(@x)))) -> c_137() , 142: #succ^#(#pos(#s(@x))) -> c_138() , 143: #positive^#(#0()) -> c_147() , 144: #positive^#(#neg(@x)) -> c_148() , 145: #positive^#(#pos(@x)) -> c_149() , 146: #positive^#(#s(@x)) -> c_150() , 147: #natdiv^#(#0(), #0()) -> c_143() , 148: #natdiv^#(#0(), #s(@y)) -> c_144() , 149: #natdiv^#(#s(@x), #0()) -> c_145() , 150: #natdiv^#(#s(@x), #s(@y)) -> c_146(#natdiv'^#(#divsub(@x, @y), #s(@y)), #divsub^#(@x, @y)) , 151: #negative^#(#0()) -> c_151() , 152: #negative^#(#neg(@x)) -> c_152() , 153: #negative^#(#pos(@x)) -> c_153() , 154: #negative^#(#s(@x)) -> c_154() , 155: #natdiv'^#(#0(), @y) -> c_163() , 156: #natdiv'^#(#s(@x), @y) -> c_164(#natdiv^#(#s(@x), @y)) , 157: #natdiv'^#(#underflow(), @y) -> c_165() , 158: #divsub^#(#0(), #0()) -> c_155() , 159: #divsub^#(#0(), #s(@y)) -> c_156() , 160: #divsub^#(#s(@x), #0()) -> c_157() , 161: #divsub^#(#s(@x), #s(@y)) -> c_158(#divsub^#(@x, @y)) , 162: #natadd^#(#0(), @y) -> c_161() , 163: #natadd^#(#s(@x), @y) -> c_162(#natadd^#(@x, @y)) , 164: #natsub^#(@x, #0()) -> c_166() , 165: #natsub^#(#s(@x), #s(@y)) -> c_167(#natsub^#(@x, @y)) } We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^2)). Strict DPs: { add^#(@b1, @b2) -> c_11(add'^#(@b1, @b2, #abs(#0())), #abs^#(#0())) , add'^#(@b1, @b2, @r) -> c_12(add'#1^#(@b1, @b2, @r)) , add'#1^#(::(@x, @xs), @b2, @r) -> c_13(add'#2^#(@b2, @r, @x, @xs)) , add'#2^#(::(@y, @ys), @r, @x, @xs) -> c_15(add'#3^#(sum(@x, @y, @r), @xs, @ys), sum^#(@x, @y, @r)) , add'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_18(add'^#(@xs, @ys, @r')) , sum^#(@x, @y, @r) -> c_17(sum#1^#(+(+(@x, @y), @r)), +^#(+(@x, @y), @r), +^#(@x, @y)) , bitToInt^#(@b) -> c_19(bitToInt'^#(@b, #abs(#pos(#s(#0())))), #abs^#(#pos(#s(#0())))) , bitToInt'^#(@b, @n) -> c_20(bitToInt'#1^#(@b, @n)) , bitToInt'#1^#(::(@x, @xs), @n) -> c_21(+^#(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))), *^#(@x, @n), bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))), *^#(@n, #pos(#s(#s(#0()))))) , compare^#(@b1, @b2) -> c_23(compare#1^#(@b1, @b2)) , compare#1^#(::(@x, @xs), @b2) -> c_24(compare#2^#(@b2, @x, @xs)) , compare#2^#(::(@y, @ys), @x, @xs) -> c_26(compare#3^#(compare(@xs, @ys), @x, @y), compare^#(@xs, @ys)) , leq^#(@b1, @b2) -> c_40(#less^#(compare(@b1, @b2), #pos(#s(#0()))), compare^#(@b1, @b2)) , mult^#(@b1, @b2) -> c_41(mult#1^#(@b1, @b2)) , mult#1^#(::(@x, @xs), @b2) -> c_42(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x), #abs^#(#0()), mult^#(@xs, @b2)) , mult#2^#(@zs, @b2, @x) -> c_44(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs), #equal^#(@x, #pos(#s(#0())))) , mult#3^#(#true(), @b2, @zs) -> c_46(add^#(@b2, @zs)) , mult3^#(@b1, @b2, @b3) -> c_47(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2)) , sub^#(@b1, @b2) -> c_48(sub#1^#(sub'(@b1, @b2, #abs(#0()))), sub'^#(@b1, @b2, #abs(#0())), #abs^#(#0())) , sub'^#(@b1, @b2, @r) -> c_49(sub'#1^#(@b1, @b2, @r)) , sub'#1^#(::(@x, @xs), @b2, @r) -> c_51(sub'#2^#(@b2, @r, @x, @xs)) , sub'#2^#(::(@y, @ys), @r, @x, @xs) -> c_53(sub'#3^#(diff(@x, @y, @r), @xs, @ys), diff^#(@x, @y, @r)) , sub'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_55(sub'#4^#(sub'(@xs, @ys, @r'), @z), sub'^#(@xs, @ys, @r')) } Weak DPs: { #abs^#(#0()) -> c_1() , #abs^#(#pos(@x)) -> c_3() , #equal^#(@x, @y) -> c_5(#eq^#(@x, @y)) , #eq^#(#0(), #0()) -> c_66() , #eq^#(#0(), #neg(@y)) -> c_67() , #eq^#(#0(), #pos(@y)) -> c_68() , #eq^#(#0(), #s(@y)) -> c_69() , #eq^#(#neg(@x), #0()) -> c_70() , #eq^#(#neg(@x), #neg(@y)) -> c_71(#eq^#(@x, @y)) , #eq^#(#neg(@x), #pos(@y)) -> c_72() , #eq^#(#pos(@x), #0()) -> c_73() , #eq^#(#pos(@x), #neg(@y)) -> c_74() , #eq^#(#pos(@x), #pos(@y)) -> c_75(#eq^#(@x, @y)) , #eq^#(#s(@x), #0()) -> c_76() , #eq^#(#s(@x), #s(@y)) -> c_77(#eq^#(@x, @y)) , #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) -> c_78(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)), #eq^#(@x_1, @y_1), #eq^#(@x_2, @y_2)) , #eq^#(::(@x_1, @x_2), nil()) -> c_79() , #eq^#(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> c_80() , #eq^#(nil(), ::(@y_1, @y_2)) -> c_81() , #eq^#(nil(), nil()) -> c_82() , #eq^#(nil(), tuple#2(@y_1, @y_2)) -> c_83() , #eq^#(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> c_84() , #eq^#(tuple#2(@x_1, @x_2), nil()) -> c_85() , #eq^#(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> c_86(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)), #eq^#(@x_1, @y_1), #eq^#(@x_2, @y_2)) , #greater^#(@x, @y) -> c_6(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y)) , #ckgt^#(#EQ()) -> c_99() , #ckgt^#(#GT()) -> c_100() , #ckgt^#(#LT()) -> c_101() , #compare^#(#0(), #0()) -> c_87() , #compare^#(#0(), #neg(@y)) -> c_88() , #compare^#(#0(), #pos(@y)) -> c_89() , #compare^#(#0(), #s(@y)) -> c_90() , #compare^#(#neg(@x), #0()) -> c_91() , #compare^#(#neg(@x), #neg(@y)) -> c_92(#compare^#(@y, @x)) , #compare^#(#neg(@x), #pos(@y)) -> c_93() , #compare^#(#pos(@x), #0()) -> c_94() , #compare^#(#pos(@x), #neg(@y)) -> c_95() , #compare^#(#pos(@x), #pos(@y)) -> c_96(#compare^#(@x, @y)) , #compare^#(#s(@x), #0()) -> c_97() , #compare^#(#s(@x), #s(@y)) -> c_98(#compare^#(@x, @y)) , #less^#(@x, @y) -> c_7(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y)) , #cklt^#(#EQ()) -> c_102() , #cklt^#(#GT()) -> c_103() , #cklt^#(#LT()) -> c_104() , *^#(@x, @y) -> c_8(#mult^#(@x, @y)) , #mult^#(#0(), #0()) -> c_105() , #mult^#(#0(), #neg(@y)) -> c_106() , #mult^#(#0(), #pos(@y)) -> c_107() , #mult^#(#neg(@x), #0()) -> c_108() , #mult^#(#neg(@x), #neg(@y)) -> c_109(#natmult^#(@x, @y)) , #mult^#(#neg(@x), #pos(@y)) -> c_110(#natmult^#(@x, @y)) , #mult^#(#pos(@x), #0()) -> c_111() , #mult^#(#pos(@x), #neg(@y)) -> c_112(#natmult^#(@x, @y)) , #mult^#(#pos(@x), #pos(@y)) -> c_113(#natmult^#(@x, @y)) , +^#(@x, @y) -> c_9(#add^#(@x, @y)) , #add^#(#0(), @y) -> c_114() , #add^#(#neg(#s(#0())), @y) -> c_115(#pred^#(@y)) , #add^#(#neg(#s(#s(@x))), @y) -> c_116(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) , #add^#(#pos(#s(#0())), @y) -> c_117(#succ^#(@y)) , #add^#(#pos(#s(#s(@x))), @y) -> c_118(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) , -^#(@x, @y) -> c_10(#sub^#(@x, @y)) , #sub^#(@x, #0()) -> c_119() , #sub^#(@x, #neg(@y)) -> c_120(#add^#(@x, #pos(@y))) , #sub^#(@x, #pos(@y)) -> c_121(#add^#(@x, #neg(@y))) , add'#1^#(nil(), @b2, @r) -> c_14() , add'#2^#(nil(), @r, @x, @xs) -> c_16() , sum#1^#(@s) -> c_59(sum#2^#(#equal(@s, #0()), @s), #equal^#(@s, #0())) , bitToInt'#1^#(nil(), @n) -> c_22(#abs^#(#0())) , compare#1^#(nil(), @b2) -> c_25(#abs^#(#0())) , compare#2^#(nil(), @x, @xs) -> c_27(#abs^#(#0())) , compare#3^#(@r, @x, @y) -> c_28(compare#4^#(#equal(@r, #0()), @r, @x, @y), #equal^#(@r, #0())) , compare#4^#(#false(), @r, @x, @y) -> c_29() , compare#4^#(#true(), @r, @x, @y) -> c_30(compare#5^#(#less(@x, @y), @x, @y), #less^#(@x, @y)) , compare#5^#(#false(), @x, @y) -> c_31(compare#6^#(#greater(@x, @y)), #greater^#(@x, @y)) , compare#5^#(#true(), @x, @y) -> c_32(-^#(#0(), #pos(#s(#0())))) , compare#6^#(#false()) -> c_33(#abs^#(#0())) , compare#6^#(#true()) -> c_34(#abs^#(#pos(#s(#0())))) , diff^#(@x, @y, @r) -> c_35(mod^#(+(+(@x, @y), @r), #pos(#s(#s(#0())))), +^#(+(@x, @y), @r), +^#(@x, @y), diff#1^#(#less(-(-(@x, @y), @r), #0())), #less^#(-(-(@x, @y), @r), #0()), -^#(-(@x, @y), @r), -^#(@x, @y)) , mod^#(@x, @y) -> c_36(-^#(@x, *(@y, div(@x, @y))), *^#(@y, div(@x, @y)), div^#(@x, @y)) , diff#1^#(#false()) -> c_37(#abs^#(#0())) , diff#1^#(#true()) -> c_38(#abs^#(#pos(#s(#0())))) , div^#(@x, @y) -> c_39(#div^#(@x, @y)) , #div^#(#0(), #0()) -> c_122() , #div^#(#0(), #neg(@y)) -> c_123() , #div^#(#0(), #pos(@y)) -> c_124() , #div^#(#neg(@x), #0()) -> c_125() , #div^#(#neg(@x), #neg(@y)) -> c_126(#positive^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) , #div^#(#neg(@x), #pos(@y)) -> c_127(#negative^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) , #div^#(#pos(@x), #0()) -> c_128() , #div^#(#pos(@x), #neg(@y)) -> c_129(#negative^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) , #div^#(#pos(@x), #pos(@y)) -> c_130(#positive^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) , mult#1^#(nil(), @b2) -> c_43() , mult#3^#(#false(), @b2, @zs) -> c_45() , sub#1^#(tuple#2(@b, @_@1)) -> c_50() , sub'#1^#(nil(), @b2, @r) -> c_52() , sub'#2^#(nil(), @r, @x, @xs) -> c_54() , sub'#4^#(tuple#2(@zs, @s), @z) -> c_56(sub'#5^#(#equal(@s, #pos(#s(#0()))), @z, @zs), #equal^#(@s, #pos(#s(#0())))) , sub'#5^#(#false(), @z, @zs) -> c_57() , sub'#5^#(#true(), @z, @zs) -> c_58(#abs^#(#0())) , sum#2^#(#false(), @s) -> c_60(sum#3^#(#equal(@s, #pos(#s(#0()))), @s), #equal^#(@s, #pos(#s(#0())))) , sum#2^#(#true(), @s) -> c_61(#abs^#(#0()), #abs^#(#0())) , sum#3^#(#false(), @s) -> c_62(sum#4^#(#equal(@s, #pos(#s(#s(#0()))))), #equal^#(@s, #pos(#s(#s(#0()))))) , sum#3^#(#true(), @s) -> c_63(#abs^#(#pos(#s(#0()))), #abs^#(#0())) , sum#4^#(#false()) -> c_64(#abs^#(#pos(#s(#0()))), #abs^#(#pos(#s(#0())))) , sum#4^#(#true()) -> c_65(#abs^#(#0()), #abs^#(#pos(#s(#0())))) , #and^#(#false(), #false()) -> c_139() , #and^#(#false(), #true()) -> c_140() , #and^#(#true(), #false()) -> c_141() , #and^#(#true(), #true()) -> c_142() , #natmult^#(#0(), @y) -> c_159() , #natmult^#(#s(@x), @y) -> c_160(#natadd^#(@y, #natmult(@x, @y)), #natmult^#(@x, @y)) , #pred^#(#0()) -> c_131() , #pred^#(#neg(#s(@x))) -> c_132() , #pred^#(#pos(#s(#0()))) -> c_133() , #pred^#(#pos(#s(#s(@x)))) -> c_134() , #succ^#(#0()) -> c_135() , #succ^#(#neg(#s(#0()))) -> c_136() , #succ^#(#neg(#s(#s(@x)))) -> c_137() , #succ^#(#pos(#s(@x))) -> c_138() , #positive^#(#0()) -> c_147() , #positive^#(#neg(@x)) -> c_148() , #positive^#(#pos(@x)) -> c_149() , #positive^#(#s(@x)) -> c_150() , #natdiv^#(#0(), #0()) -> c_143() , #natdiv^#(#0(), #s(@y)) -> c_144() , #natdiv^#(#s(@x), #0()) -> c_145() , #natdiv^#(#s(@x), #s(@y)) -> c_146(#natdiv'^#(#divsub(@x, @y), #s(@y)), #divsub^#(@x, @y)) , #negative^#(#0()) -> c_151() , #negative^#(#neg(@x)) -> c_152() , #negative^#(#pos(@x)) -> c_153() , #negative^#(#s(@x)) -> c_154() , #natdiv'^#(#0(), @y) -> c_163() , #natdiv'^#(#s(@x), @y) -> c_164(#natdiv^#(#s(@x), @y)) , #natdiv'^#(#underflow(), @y) -> c_165() , #divsub^#(#0(), #0()) -> c_155() , #divsub^#(#0(), #s(@y)) -> c_156() , #divsub^#(#s(@x), #0()) -> c_157() , #divsub^#(#s(@x), #s(@y)) -> c_158(#divsub^#(@x, @y)) , #natadd^#(#0(), @y) -> c_161() , #natadd^#(#s(@x), @y) -> c_162(#natadd^#(@x, @y)) , #natsub^#(@x, #0()) -> c_166() , #natsub^#(#s(@x), #s(@y)) -> c_167(#natsub^#(@x, @y)) } Weak Trs: { #abs(#0()) -> #0() , #abs(#neg(@x)) -> #pos(@x) , #abs(#pos(@x)) -> #pos(@x) , #abs(#s(@x)) -> #pos(#s(@x)) , #equal(@x, @y) -> #eq(@x, @y) , #eq(#0(), #0()) -> #true() , #eq(#0(), #neg(@y)) -> #false() , #eq(#0(), #pos(@y)) -> #false() , #eq(#0(), #s(@y)) -> #false() , #eq(#neg(@x), #0()) -> #false() , #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #pos(@y)) -> #false() , #eq(#pos(@x), #0()) -> #false() , #eq(#pos(@x), #neg(@y)) -> #false() , #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y) , #eq(#s(@x), #0()) -> #false() , #eq(#s(@x), #s(@y)) -> #eq(@x, @y) , #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #eq(::(@x_1, @x_2), nil()) -> #false() , #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false() , #eq(nil(), ::(@y_1, @y_2)) -> #false() , #eq(nil(), nil()) -> #true() , #eq(nil(), tuple#2(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), nil()) -> #false() , #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #greater(@x, @y) -> #ckgt(#compare(@x, @y)) , #compare(#0(), #0()) -> #EQ() , #compare(#0(), #neg(@y)) -> #GT() , #compare(#0(), #pos(@y)) -> #LT() , #compare(#0(), #s(@y)) -> #LT() , #compare(#neg(@x), #0()) -> #LT() , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x) , #compare(#neg(@x), #pos(@y)) -> #LT() , #compare(#pos(@x), #0()) -> #GT() , #compare(#pos(@x), #neg(@y)) -> #GT() , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y) , #compare(#s(@x), #0()) -> #GT() , #compare(#s(@x), #s(@y)) -> #compare(@x, @y) , #ckgt(#EQ()) -> #false() , #ckgt(#GT()) -> #true() , #ckgt(#LT()) -> #false() , #less(@x, @y) -> #cklt(#compare(@x, @y)) , #cklt(#EQ()) -> #false() , #cklt(#GT()) -> #false() , #cklt(#LT()) -> #true() , *(@x, @y) -> #mult(@x, @y) , #mult(#0(), #0()) -> #0() , #mult(#0(), #neg(@y)) -> #0() , #mult(#0(), #pos(@y)) -> #0() , #mult(#neg(@x), #0()) -> #0() , #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y)) , #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #0()) -> #0() , #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y)) , +(@x, @y) -> #add(@x, @y) , #add(#0(), @y) -> @y , #add(#neg(#s(#0())), @y) -> #pred(@y) , #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y)) , #add(#pos(#s(#0())), @y) -> #succ(@y) , #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y)) , -(@x, @y) -> #sub(@x, @y) , #sub(@x, #0()) -> @x , #sub(@x, #neg(@y)) -> #add(@x, #pos(@y)) , #sub(@x, #pos(@y)) -> #add(@x, #neg(@y)) , add(@b1, @b2) -> add'(@b1, @b2, #abs(#0())) , add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r) , add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs) , add'#1(nil(), @b2, @r) -> nil() , add'#2(::(@y, @ys), @r, @x, @xs) -> add'#3(sum(@x, @y, @r), @xs, @ys) , add'#2(nil(), @r, @x, @xs) -> nil() , sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r)) , add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r')) , bitToInt(@b) -> bitToInt'(@b, #abs(#pos(#s(#0())))) , bitToInt'(@b, @n) -> bitToInt'#1(@b, @n) , bitToInt'#1(::(@x, @xs), @n) -> +(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))) , bitToInt'#1(nil(), @n) -> #abs(#0()) , compare(@b1, @b2) -> compare#1(@b1, @b2) , compare#1(::(@x, @xs), @b2) -> compare#2(@b2, @x, @xs) , compare#1(nil(), @b2) -> #abs(#0()) , compare#2(::(@y, @ys), @x, @xs) -> compare#3(compare(@xs, @ys), @x, @y) , compare#2(nil(), @x, @xs) -> #abs(#0()) , compare#3(@r, @x, @y) -> compare#4(#equal(@r, #0()), @r, @x, @y) , compare#4(#false(), @r, @x, @y) -> @r , compare#4(#true(), @r, @x, @y) -> compare#5(#less(@x, @y), @x, @y) , compare#5(#false(), @x, @y) -> compare#6(#greater(@x, @y)) , compare#5(#true(), @x, @y) -> -(#0(), #pos(#s(#0()))) , compare#6(#false()) -> #abs(#0()) , compare#6(#true()) -> #abs(#pos(#s(#0()))) , diff(@x, @y, @r) -> tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))), diff#1(#less(-(-(@x, @y), @r), #0()))) , mod(@x, @y) -> -(@x, *(@y, div(@x, @y))) , diff#1(#false()) -> #abs(#0()) , diff#1(#true()) -> #abs(#pos(#s(#0()))) , div(@x, @y) -> #div(@x, @y) , #div(#0(), #0()) -> #divByZero() , #div(#0(), #neg(@y)) -> #0() , #div(#0(), #pos(@y)) -> #0() , #div(#neg(@x), #0()) -> #divByZero() , #div(#neg(@x), #neg(@y)) -> #positive(#natdiv(@x, @y)) , #div(#neg(@x), #pos(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #0()) -> #divByZero() , #div(#pos(@x), #neg(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #pos(@y)) -> #positive(#natdiv(@x, @y)) , leq(@b1, @b2) -> #less(compare(@b1, @b2), #pos(#s(#0()))) , mult(@b1, @b2) -> mult#1(@b1, @b2) , mult#1(::(@x, @xs), @b2) -> mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x) , mult#1(nil(), @b2) -> nil() , mult#2(@zs, @b2, @x) -> mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs) , mult#3(#false(), @b2, @zs) -> @zs , mult#3(#true(), @b2, @zs) -> add(@b2, @zs) , mult3(@b1, @b2, @b3) -> mult(mult(@b1, @b2), @b2) , sub(@b1, @b2) -> sub#1(sub'(@b1, @b2, #abs(#0()))) , sub'(@b1, @b2, @r) -> sub'#1(@b1, @b2, @r) , sub#1(tuple#2(@b, @_@1)) -> @b , sub'#1(::(@x, @xs), @b2, @r) -> sub'#2(@b2, @r, @x, @xs) , sub'#1(nil(), @b2, @r) -> tuple#2(nil(), @r) , sub'#2(::(@y, @ys), @r, @x, @xs) -> sub'#3(diff(@x, @y, @r), @xs, @ys) , sub'#2(nil(), @r, @x, @xs) -> tuple#2(nil(), @r) , sub'#3(tuple#2(@z, @r'), @xs, @ys) -> sub'#4(sub'(@xs, @ys, @r'), @z) , sub'#4(tuple#2(@zs, @s), @z) -> tuple#2(sub'#5(#equal(@s, #pos(#s(#0()))), @z, @zs), @s) , sub'#5(#false(), @z, @zs) -> ::(@z, @zs) , sub'#5(#true(), @z, @zs) -> ::(#abs(#0()), @zs) , sum#1(@s) -> sum#2(#equal(@s, #0()), @s) , sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s) , sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0())) , sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0()))))) , sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0())) , sum#4(#false()) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0())))) , sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0())))) , #pred(#0()) -> #neg(#s(#0())) , #pred(#neg(#s(@x))) -> #neg(#s(#s(@x))) , #pred(#pos(#s(#0()))) -> #0() , #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x)) , #succ(#0()) -> #pos(#s(#0())) , #succ(#neg(#s(#0()))) -> #0() , #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x)) , #succ(#pos(#s(@x))) -> #pos(#s(#s(@x))) , #and(#false(), #false()) -> #false() , #and(#false(), #true()) -> #false() , #and(#true(), #false()) -> #false() , #and(#true(), #true()) -> #true() , #natdiv(#0(), #0()) -> #divByZero() , #natdiv(#0(), #s(@y)) -> #0() , #natdiv(#s(@x), #0()) -> #divByZero() , #natdiv(#s(@x), #s(@y)) -> #natdiv'(#divsub(@x, @y), #s(@y)) , #positive(#0()) -> #0() , #positive(#neg(@x)) -> #neg(@x) , #positive(#pos(@x)) -> #pos(@x) , #positive(#s(@x)) -> #pos(#s(@x)) , #negative(#0()) -> #0() , #negative(#neg(@x)) -> #pos(@x) , #negative(#pos(@x)) -> #neg(@x) , #negative(#s(@x)) -> #neg(#s(@x)) , #divsub(#0(), #0()) -> #0() , #divsub(#0(), #s(@y)) -> #underflow() , #divsub(#s(@x), #0()) -> #s(@x) , #divsub(#s(@x), #s(@y)) -> #divsub(@x, @y) , #natmult(#0(), @y) -> #0() , #natmult(#s(@x), @y) -> #natadd(@y, #natmult(@x, @y)) , #natadd(#0(), @y) -> @y , #natadd(#s(@x), @y) -> #s(#natadd(@x, @y)) , #natdiv'(#0(), @y) -> #s(#0()) , #natdiv'(#s(@x), @y) -> #s(#natdiv(#s(@x), @y)) , #natdiv'(#underflow(), @y) -> #0() , #natsub(@x, #0()) -> @x , #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^2)) We estimate the number of application of {6} by applications of Pre({6}) = {4}. Here rules are labeled as follows: DPs: { 1: add^#(@b1, @b2) -> c_11(add'^#(@b1, @b2, #abs(#0())), #abs^#(#0())) , 2: add'^#(@b1, @b2, @r) -> c_12(add'#1^#(@b1, @b2, @r)) , 3: add'#1^#(::(@x, @xs), @b2, @r) -> c_13(add'#2^#(@b2, @r, @x, @xs)) , 4: add'#2^#(::(@y, @ys), @r, @x, @xs) -> c_15(add'#3^#(sum(@x, @y, @r), @xs, @ys), sum^#(@x, @y, @r)) , 5: add'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_18(add'^#(@xs, @ys, @r')) , 6: sum^#(@x, @y, @r) -> c_17(sum#1^#(+(+(@x, @y), @r)), +^#(+(@x, @y), @r), +^#(@x, @y)) , 7: bitToInt^#(@b) -> c_19(bitToInt'^#(@b, #abs(#pos(#s(#0())))), #abs^#(#pos(#s(#0())))) , 8: bitToInt'^#(@b, @n) -> c_20(bitToInt'#1^#(@b, @n)) , 9: bitToInt'#1^#(::(@x, @xs), @n) -> c_21(+^#(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))), *^#(@x, @n), bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))), *^#(@n, #pos(#s(#s(#0()))))) , 10: compare^#(@b1, @b2) -> c_23(compare#1^#(@b1, @b2)) , 11: compare#1^#(::(@x, @xs), @b2) -> c_24(compare#2^#(@b2, @x, @xs)) , 12: compare#2^#(::(@y, @ys), @x, @xs) -> c_26(compare#3^#(compare(@xs, @ys), @x, @y), compare^#(@xs, @ys)) , 13: leq^#(@b1, @b2) -> c_40(#less^#(compare(@b1, @b2), #pos(#s(#0()))), compare^#(@b1, @b2)) , 14: mult^#(@b1, @b2) -> c_41(mult#1^#(@b1, @b2)) , 15: mult#1^#(::(@x, @xs), @b2) -> c_42(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x), #abs^#(#0()), mult^#(@xs, @b2)) , 16: mult#2^#(@zs, @b2, @x) -> c_44(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs), #equal^#(@x, #pos(#s(#0())))) , 17: mult#3^#(#true(), @b2, @zs) -> c_46(add^#(@b2, @zs)) , 18: mult3^#(@b1, @b2, @b3) -> c_47(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2)) , 19: sub^#(@b1, @b2) -> c_48(sub#1^#(sub'(@b1, @b2, #abs(#0()))), sub'^#(@b1, @b2, #abs(#0())), #abs^#(#0())) , 20: sub'^#(@b1, @b2, @r) -> c_49(sub'#1^#(@b1, @b2, @r)) , 21: sub'#1^#(::(@x, @xs), @b2, @r) -> c_51(sub'#2^#(@b2, @r, @x, @xs)) , 22: sub'#2^#(::(@y, @ys), @r, @x, @xs) -> c_53(sub'#3^#(diff(@x, @y, @r), @xs, @ys), diff^#(@x, @y, @r)) , 23: sub'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_55(sub'#4^#(sub'(@xs, @ys, @r'), @z), sub'^#(@xs, @ys, @r')) , 24: #abs^#(#0()) -> c_1() , 25: #abs^#(#pos(@x)) -> c_3() , 26: #equal^#(@x, @y) -> c_5(#eq^#(@x, @y)) , 27: #eq^#(#0(), #0()) -> c_66() , 28: #eq^#(#0(), #neg(@y)) -> c_67() , 29: #eq^#(#0(), #pos(@y)) -> c_68() , 30: #eq^#(#0(), #s(@y)) -> c_69() , 31: #eq^#(#neg(@x), #0()) -> c_70() , 32: #eq^#(#neg(@x), #neg(@y)) -> c_71(#eq^#(@x, @y)) , 33: #eq^#(#neg(@x), #pos(@y)) -> c_72() , 34: #eq^#(#pos(@x), #0()) -> c_73() , 35: #eq^#(#pos(@x), #neg(@y)) -> c_74() , 36: #eq^#(#pos(@x), #pos(@y)) -> c_75(#eq^#(@x, @y)) , 37: #eq^#(#s(@x), #0()) -> c_76() , 38: #eq^#(#s(@x), #s(@y)) -> c_77(#eq^#(@x, @y)) , 39: #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) -> c_78(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)), #eq^#(@x_1, @y_1), #eq^#(@x_2, @y_2)) , 40: #eq^#(::(@x_1, @x_2), nil()) -> c_79() , 41: #eq^#(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> c_80() , 42: #eq^#(nil(), ::(@y_1, @y_2)) -> c_81() , 43: #eq^#(nil(), nil()) -> c_82() , 44: #eq^#(nil(), tuple#2(@y_1, @y_2)) -> c_83() , 45: #eq^#(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> c_84() , 46: #eq^#(tuple#2(@x_1, @x_2), nil()) -> c_85() , 47: #eq^#(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> c_86(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)), #eq^#(@x_1, @y_1), #eq^#(@x_2, @y_2)) , 48: #greater^#(@x, @y) -> c_6(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y)) , 49: #ckgt^#(#EQ()) -> c_99() , 50: #ckgt^#(#GT()) -> c_100() , 51: #ckgt^#(#LT()) -> c_101() , 52: #compare^#(#0(), #0()) -> c_87() , 53: #compare^#(#0(), #neg(@y)) -> c_88() , 54: #compare^#(#0(), #pos(@y)) -> c_89() , 55: #compare^#(#0(), #s(@y)) -> c_90() , 56: #compare^#(#neg(@x), #0()) -> c_91() , 57: #compare^#(#neg(@x), #neg(@y)) -> c_92(#compare^#(@y, @x)) , 58: #compare^#(#neg(@x), #pos(@y)) -> c_93() , 59: #compare^#(#pos(@x), #0()) -> c_94() , 60: #compare^#(#pos(@x), #neg(@y)) -> c_95() , 61: #compare^#(#pos(@x), #pos(@y)) -> c_96(#compare^#(@x, @y)) , 62: #compare^#(#s(@x), #0()) -> c_97() , 63: #compare^#(#s(@x), #s(@y)) -> c_98(#compare^#(@x, @y)) , 64: #less^#(@x, @y) -> c_7(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y)) , 65: #cklt^#(#EQ()) -> c_102() , 66: #cklt^#(#GT()) -> c_103() , 67: #cklt^#(#LT()) -> c_104() , 68: *^#(@x, @y) -> c_8(#mult^#(@x, @y)) , 69: #mult^#(#0(), #0()) -> c_105() , 70: #mult^#(#0(), #neg(@y)) -> c_106() , 71: #mult^#(#0(), #pos(@y)) -> c_107() , 72: #mult^#(#neg(@x), #0()) -> c_108() , 73: #mult^#(#neg(@x), #neg(@y)) -> c_109(#natmult^#(@x, @y)) , 74: #mult^#(#neg(@x), #pos(@y)) -> c_110(#natmult^#(@x, @y)) , 75: #mult^#(#pos(@x), #0()) -> c_111() , 76: #mult^#(#pos(@x), #neg(@y)) -> c_112(#natmult^#(@x, @y)) , 77: #mult^#(#pos(@x), #pos(@y)) -> c_113(#natmult^#(@x, @y)) , 78: +^#(@x, @y) -> c_9(#add^#(@x, @y)) , 79: #add^#(#0(), @y) -> c_114() , 80: #add^#(#neg(#s(#0())), @y) -> c_115(#pred^#(@y)) , 81: #add^#(#neg(#s(#s(@x))), @y) -> c_116(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) , 82: #add^#(#pos(#s(#0())), @y) -> c_117(#succ^#(@y)) , 83: #add^#(#pos(#s(#s(@x))), @y) -> c_118(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) , 84: -^#(@x, @y) -> c_10(#sub^#(@x, @y)) , 85: #sub^#(@x, #0()) -> c_119() , 86: #sub^#(@x, #neg(@y)) -> c_120(#add^#(@x, #pos(@y))) , 87: #sub^#(@x, #pos(@y)) -> c_121(#add^#(@x, #neg(@y))) , 88: add'#1^#(nil(), @b2, @r) -> c_14() , 89: add'#2^#(nil(), @r, @x, @xs) -> c_16() , 90: sum#1^#(@s) -> c_59(sum#2^#(#equal(@s, #0()), @s), #equal^#(@s, #0())) , 91: bitToInt'#1^#(nil(), @n) -> c_22(#abs^#(#0())) , 92: compare#1^#(nil(), @b2) -> c_25(#abs^#(#0())) , 93: compare#2^#(nil(), @x, @xs) -> c_27(#abs^#(#0())) , 94: compare#3^#(@r, @x, @y) -> c_28(compare#4^#(#equal(@r, #0()), @r, @x, @y), #equal^#(@r, #0())) , 95: compare#4^#(#false(), @r, @x, @y) -> c_29() , 96: compare#4^#(#true(), @r, @x, @y) -> c_30(compare#5^#(#less(@x, @y), @x, @y), #less^#(@x, @y)) , 97: compare#5^#(#false(), @x, @y) -> c_31(compare#6^#(#greater(@x, @y)), #greater^#(@x, @y)) , 98: compare#5^#(#true(), @x, @y) -> c_32(-^#(#0(), #pos(#s(#0())))) , 99: compare#6^#(#false()) -> c_33(#abs^#(#0())) , 100: compare#6^#(#true()) -> c_34(#abs^#(#pos(#s(#0())))) , 101: diff^#(@x, @y, @r) -> c_35(mod^#(+(+(@x, @y), @r), #pos(#s(#s(#0())))), +^#(+(@x, @y), @r), +^#(@x, @y), diff#1^#(#less(-(-(@x, @y), @r), #0())), #less^#(-(-(@x, @y), @r), #0()), -^#(-(@x, @y), @r), -^#(@x, @y)) , 102: mod^#(@x, @y) -> c_36(-^#(@x, *(@y, div(@x, @y))), *^#(@y, div(@x, @y)), div^#(@x, @y)) , 103: diff#1^#(#false()) -> c_37(#abs^#(#0())) , 104: diff#1^#(#true()) -> c_38(#abs^#(#pos(#s(#0())))) , 105: div^#(@x, @y) -> c_39(#div^#(@x, @y)) , 106: #div^#(#0(), #0()) -> c_122() , 107: #div^#(#0(), #neg(@y)) -> c_123() , 108: #div^#(#0(), #pos(@y)) -> c_124() , 109: #div^#(#neg(@x), #0()) -> c_125() , 110: #div^#(#neg(@x), #neg(@y)) -> c_126(#positive^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) , 111: #div^#(#neg(@x), #pos(@y)) -> c_127(#negative^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) , 112: #div^#(#pos(@x), #0()) -> c_128() , 113: #div^#(#pos(@x), #neg(@y)) -> c_129(#negative^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) , 114: #div^#(#pos(@x), #pos(@y)) -> c_130(#positive^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) , 115: mult#1^#(nil(), @b2) -> c_43() , 116: mult#3^#(#false(), @b2, @zs) -> c_45() , 117: sub#1^#(tuple#2(@b, @_@1)) -> c_50() , 118: sub'#1^#(nil(), @b2, @r) -> c_52() , 119: sub'#2^#(nil(), @r, @x, @xs) -> c_54() , 120: sub'#4^#(tuple#2(@zs, @s), @z) -> c_56(sub'#5^#(#equal(@s, #pos(#s(#0()))), @z, @zs), #equal^#(@s, #pos(#s(#0())))) , 121: sub'#5^#(#false(), @z, @zs) -> c_57() , 122: sub'#5^#(#true(), @z, @zs) -> c_58(#abs^#(#0())) , 123: sum#2^#(#false(), @s) -> c_60(sum#3^#(#equal(@s, #pos(#s(#0()))), @s), #equal^#(@s, #pos(#s(#0())))) , 124: sum#2^#(#true(), @s) -> c_61(#abs^#(#0()), #abs^#(#0())) , 125: sum#3^#(#false(), @s) -> c_62(sum#4^#(#equal(@s, #pos(#s(#s(#0()))))), #equal^#(@s, #pos(#s(#s(#0()))))) , 126: sum#3^#(#true(), @s) -> c_63(#abs^#(#pos(#s(#0()))), #abs^#(#0())) , 127: sum#4^#(#false()) -> c_64(#abs^#(#pos(#s(#0()))), #abs^#(#pos(#s(#0())))) , 128: sum#4^#(#true()) -> c_65(#abs^#(#0()), #abs^#(#pos(#s(#0())))) , 129: #and^#(#false(), #false()) -> c_139() , 130: #and^#(#false(), #true()) -> c_140() , 131: #and^#(#true(), #false()) -> c_141() , 132: #and^#(#true(), #true()) -> c_142() , 133: #natmult^#(#0(), @y) -> c_159() , 134: #natmult^#(#s(@x), @y) -> c_160(#natadd^#(@y, #natmult(@x, @y)), #natmult^#(@x, @y)) , 135: #pred^#(#0()) -> c_131() , 136: #pred^#(#neg(#s(@x))) -> c_132() , 137: #pred^#(#pos(#s(#0()))) -> c_133() , 138: #pred^#(#pos(#s(#s(@x)))) -> c_134() , 139: #succ^#(#0()) -> c_135() , 140: #succ^#(#neg(#s(#0()))) -> c_136() , 141: #succ^#(#neg(#s(#s(@x)))) -> c_137() , 142: #succ^#(#pos(#s(@x))) -> c_138() , 143: #positive^#(#0()) -> c_147() , 144: #positive^#(#neg(@x)) -> c_148() , 145: #positive^#(#pos(@x)) -> c_149() , 146: #positive^#(#s(@x)) -> c_150() , 147: #natdiv^#(#0(), #0()) -> c_143() , 148: #natdiv^#(#0(), #s(@y)) -> c_144() , 149: #natdiv^#(#s(@x), #0()) -> c_145() , 150: #natdiv^#(#s(@x), #s(@y)) -> c_146(#natdiv'^#(#divsub(@x, @y), #s(@y)), #divsub^#(@x, @y)) , 151: #negative^#(#0()) -> c_151() , 152: #negative^#(#neg(@x)) -> c_152() , 153: #negative^#(#pos(@x)) -> c_153() , 154: #negative^#(#s(@x)) -> c_154() , 155: #natdiv'^#(#0(), @y) -> c_163() , 156: #natdiv'^#(#s(@x), @y) -> c_164(#natdiv^#(#s(@x), @y)) , 157: #natdiv'^#(#underflow(), @y) -> c_165() , 158: #divsub^#(#0(), #0()) -> c_155() , 159: #divsub^#(#0(), #s(@y)) -> c_156() , 160: #divsub^#(#s(@x), #0()) -> c_157() , 161: #divsub^#(#s(@x), #s(@y)) -> c_158(#divsub^#(@x, @y)) , 162: #natadd^#(#0(), @y) -> c_161() , 163: #natadd^#(#s(@x), @y) -> c_162(#natadd^#(@x, @y)) , 164: #natsub^#(@x, #0()) -> c_166() , 165: #natsub^#(#s(@x), #s(@y)) -> c_167(#natsub^#(@x, @y)) } We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^2)). Strict DPs: { add^#(@b1, @b2) -> c_11(add'^#(@b1, @b2, #abs(#0())), #abs^#(#0())) , add'^#(@b1, @b2, @r) -> c_12(add'#1^#(@b1, @b2, @r)) , add'#1^#(::(@x, @xs), @b2, @r) -> c_13(add'#2^#(@b2, @r, @x, @xs)) , add'#2^#(::(@y, @ys), @r, @x, @xs) -> c_15(add'#3^#(sum(@x, @y, @r), @xs, @ys), sum^#(@x, @y, @r)) , add'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_18(add'^#(@xs, @ys, @r')) , bitToInt^#(@b) -> c_19(bitToInt'^#(@b, #abs(#pos(#s(#0())))), #abs^#(#pos(#s(#0())))) , bitToInt'^#(@b, @n) -> c_20(bitToInt'#1^#(@b, @n)) , bitToInt'#1^#(::(@x, @xs), @n) -> c_21(+^#(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))), *^#(@x, @n), bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))), *^#(@n, #pos(#s(#s(#0()))))) , compare^#(@b1, @b2) -> c_23(compare#1^#(@b1, @b2)) , compare#1^#(::(@x, @xs), @b2) -> c_24(compare#2^#(@b2, @x, @xs)) , compare#2^#(::(@y, @ys), @x, @xs) -> c_26(compare#3^#(compare(@xs, @ys), @x, @y), compare^#(@xs, @ys)) , leq^#(@b1, @b2) -> c_40(#less^#(compare(@b1, @b2), #pos(#s(#0()))), compare^#(@b1, @b2)) , mult^#(@b1, @b2) -> c_41(mult#1^#(@b1, @b2)) , mult#1^#(::(@x, @xs), @b2) -> c_42(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x), #abs^#(#0()), mult^#(@xs, @b2)) , mult#2^#(@zs, @b2, @x) -> c_44(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs), #equal^#(@x, #pos(#s(#0())))) , mult#3^#(#true(), @b2, @zs) -> c_46(add^#(@b2, @zs)) , mult3^#(@b1, @b2, @b3) -> c_47(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2)) , sub^#(@b1, @b2) -> c_48(sub#1^#(sub'(@b1, @b2, #abs(#0()))), sub'^#(@b1, @b2, #abs(#0())), #abs^#(#0())) , sub'^#(@b1, @b2, @r) -> c_49(sub'#1^#(@b1, @b2, @r)) , sub'#1^#(::(@x, @xs), @b2, @r) -> c_51(sub'#2^#(@b2, @r, @x, @xs)) , sub'#2^#(::(@y, @ys), @r, @x, @xs) -> c_53(sub'#3^#(diff(@x, @y, @r), @xs, @ys), diff^#(@x, @y, @r)) , sub'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_55(sub'#4^#(sub'(@xs, @ys, @r'), @z), sub'^#(@xs, @ys, @r')) } Weak DPs: { #abs^#(#0()) -> c_1() , #abs^#(#pos(@x)) -> c_3() , #equal^#(@x, @y) -> c_5(#eq^#(@x, @y)) , #eq^#(#0(), #0()) -> c_66() , #eq^#(#0(), #neg(@y)) -> c_67() , #eq^#(#0(), #pos(@y)) -> c_68() , #eq^#(#0(), #s(@y)) -> c_69() , #eq^#(#neg(@x), #0()) -> c_70() , #eq^#(#neg(@x), #neg(@y)) -> c_71(#eq^#(@x, @y)) , #eq^#(#neg(@x), #pos(@y)) -> c_72() , #eq^#(#pos(@x), #0()) -> c_73() , #eq^#(#pos(@x), #neg(@y)) -> c_74() , #eq^#(#pos(@x), #pos(@y)) -> c_75(#eq^#(@x, @y)) , #eq^#(#s(@x), #0()) -> c_76() , #eq^#(#s(@x), #s(@y)) -> c_77(#eq^#(@x, @y)) , #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) -> c_78(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)), #eq^#(@x_1, @y_1), #eq^#(@x_2, @y_2)) , #eq^#(::(@x_1, @x_2), nil()) -> c_79() , #eq^#(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> c_80() , #eq^#(nil(), ::(@y_1, @y_2)) -> c_81() , #eq^#(nil(), nil()) -> c_82() , #eq^#(nil(), tuple#2(@y_1, @y_2)) -> c_83() , #eq^#(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> c_84() , #eq^#(tuple#2(@x_1, @x_2), nil()) -> c_85() , #eq^#(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> c_86(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)), #eq^#(@x_1, @y_1), #eq^#(@x_2, @y_2)) , #greater^#(@x, @y) -> c_6(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y)) , #ckgt^#(#EQ()) -> c_99() , #ckgt^#(#GT()) -> c_100() , #ckgt^#(#LT()) -> c_101() , #compare^#(#0(), #0()) -> c_87() , #compare^#(#0(), #neg(@y)) -> c_88() , #compare^#(#0(), #pos(@y)) -> c_89() , #compare^#(#0(), #s(@y)) -> c_90() , #compare^#(#neg(@x), #0()) -> c_91() , #compare^#(#neg(@x), #neg(@y)) -> c_92(#compare^#(@y, @x)) , #compare^#(#neg(@x), #pos(@y)) -> c_93() , #compare^#(#pos(@x), #0()) -> c_94() , #compare^#(#pos(@x), #neg(@y)) -> c_95() , #compare^#(#pos(@x), #pos(@y)) -> c_96(#compare^#(@x, @y)) , #compare^#(#s(@x), #0()) -> c_97() , #compare^#(#s(@x), #s(@y)) -> c_98(#compare^#(@x, @y)) , #less^#(@x, @y) -> c_7(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y)) , #cklt^#(#EQ()) -> c_102() , #cklt^#(#GT()) -> c_103() , #cklt^#(#LT()) -> c_104() , *^#(@x, @y) -> c_8(#mult^#(@x, @y)) , #mult^#(#0(), #0()) -> c_105() , #mult^#(#0(), #neg(@y)) -> c_106() , #mult^#(#0(), #pos(@y)) -> c_107() , #mult^#(#neg(@x), #0()) -> c_108() , #mult^#(#neg(@x), #neg(@y)) -> c_109(#natmult^#(@x, @y)) , #mult^#(#neg(@x), #pos(@y)) -> c_110(#natmult^#(@x, @y)) , #mult^#(#pos(@x), #0()) -> c_111() , #mult^#(#pos(@x), #neg(@y)) -> c_112(#natmult^#(@x, @y)) , #mult^#(#pos(@x), #pos(@y)) -> c_113(#natmult^#(@x, @y)) , +^#(@x, @y) -> c_9(#add^#(@x, @y)) , #add^#(#0(), @y) -> c_114() , #add^#(#neg(#s(#0())), @y) -> c_115(#pred^#(@y)) , #add^#(#neg(#s(#s(@x))), @y) -> c_116(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) , #add^#(#pos(#s(#0())), @y) -> c_117(#succ^#(@y)) , #add^#(#pos(#s(#s(@x))), @y) -> c_118(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) , -^#(@x, @y) -> c_10(#sub^#(@x, @y)) , #sub^#(@x, #0()) -> c_119() , #sub^#(@x, #neg(@y)) -> c_120(#add^#(@x, #pos(@y))) , #sub^#(@x, #pos(@y)) -> c_121(#add^#(@x, #neg(@y))) , add'#1^#(nil(), @b2, @r) -> c_14() , add'#2^#(nil(), @r, @x, @xs) -> c_16() , sum^#(@x, @y, @r) -> c_17(sum#1^#(+(+(@x, @y), @r)), +^#(+(@x, @y), @r), +^#(@x, @y)) , sum#1^#(@s) -> c_59(sum#2^#(#equal(@s, #0()), @s), #equal^#(@s, #0())) , bitToInt'#1^#(nil(), @n) -> c_22(#abs^#(#0())) , compare#1^#(nil(), @b2) -> c_25(#abs^#(#0())) , compare#2^#(nil(), @x, @xs) -> c_27(#abs^#(#0())) , compare#3^#(@r, @x, @y) -> c_28(compare#4^#(#equal(@r, #0()), @r, @x, @y), #equal^#(@r, #0())) , compare#4^#(#false(), @r, @x, @y) -> c_29() , compare#4^#(#true(), @r, @x, @y) -> c_30(compare#5^#(#less(@x, @y), @x, @y), #less^#(@x, @y)) , compare#5^#(#false(), @x, @y) -> c_31(compare#6^#(#greater(@x, @y)), #greater^#(@x, @y)) , compare#5^#(#true(), @x, @y) -> c_32(-^#(#0(), #pos(#s(#0())))) , compare#6^#(#false()) -> c_33(#abs^#(#0())) , compare#6^#(#true()) -> c_34(#abs^#(#pos(#s(#0())))) , diff^#(@x, @y, @r) -> c_35(mod^#(+(+(@x, @y), @r), #pos(#s(#s(#0())))), +^#(+(@x, @y), @r), +^#(@x, @y), diff#1^#(#less(-(-(@x, @y), @r), #0())), #less^#(-(-(@x, @y), @r), #0()), -^#(-(@x, @y), @r), -^#(@x, @y)) , mod^#(@x, @y) -> c_36(-^#(@x, *(@y, div(@x, @y))), *^#(@y, div(@x, @y)), div^#(@x, @y)) , diff#1^#(#false()) -> c_37(#abs^#(#0())) , diff#1^#(#true()) -> c_38(#abs^#(#pos(#s(#0())))) , div^#(@x, @y) -> c_39(#div^#(@x, @y)) , #div^#(#0(), #0()) -> c_122() , #div^#(#0(), #neg(@y)) -> c_123() , #div^#(#0(), #pos(@y)) -> c_124() , #div^#(#neg(@x), #0()) -> c_125() , #div^#(#neg(@x), #neg(@y)) -> c_126(#positive^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) , #div^#(#neg(@x), #pos(@y)) -> c_127(#negative^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) , #div^#(#pos(@x), #0()) -> c_128() , #div^#(#pos(@x), #neg(@y)) -> c_129(#negative^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) , #div^#(#pos(@x), #pos(@y)) -> c_130(#positive^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) , mult#1^#(nil(), @b2) -> c_43() , mult#3^#(#false(), @b2, @zs) -> c_45() , sub#1^#(tuple#2(@b, @_@1)) -> c_50() , sub'#1^#(nil(), @b2, @r) -> c_52() , sub'#2^#(nil(), @r, @x, @xs) -> c_54() , sub'#4^#(tuple#2(@zs, @s), @z) -> c_56(sub'#5^#(#equal(@s, #pos(#s(#0()))), @z, @zs), #equal^#(@s, #pos(#s(#0())))) , sub'#5^#(#false(), @z, @zs) -> c_57() , sub'#5^#(#true(), @z, @zs) -> c_58(#abs^#(#0())) , sum#2^#(#false(), @s) -> c_60(sum#3^#(#equal(@s, #pos(#s(#0()))), @s), #equal^#(@s, #pos(#s(#0())))) , sum#2^#(#true(), @s) -> c_61(#abs^#(#0()), #abs^#(#0())) , sum#3^#(#false(), @s) -> c_62(sum#4^#(#equal(@s, #pos(#s(#s(#0()))))), #equal^#(@s, #pos(#s(#s(#0()))))) , sum#3^#(#true(), @s) -> c_63(#abs^#(#pos(#s(#0()))), #abs^#(#0())) , sum#4^#(#false()) -> c_64(#abs^#(#pos(#s(#0()))), #abs^#(#pos(#s(#0())))) , sum#4^#(#true()) -> c_65(#abs^#(#0()), #abs^#(#pos(#s(#0())))) , #and^#(#false(), #false()) -> c_139() , #and^#(#false(), #true()) -> c_140() , #and^#(#true(), #false()) -> c_141() , #and^#(#true(), #true()) -> c_142() , #natmult^#(#0(), @y) -> c_159() , #natmult^#(#s(@x), @y) -> c_160(#natadd^#(@y, #natmult(@x, @y)), #natmult^#(@x, @y)) , #pred^#(#0()) -> c_131() , #pred^#(#neg(#s(@x))) -> c_132() , #pred^#(#pos(#s(#0()))) -> c_133() , #pred^#(#pos(#s(#s(@x)))) -> c_134() , #succ^#(#0()) -> c_135() , #succ^#(#neg(#s(#0()))) -> c_136() , #succ^#(#neg(#s(#s(@x)))) -> c_137() , #succ^#(#pos(#s(@x))) -> c_138() , #positive^#(#0()) -> c_147() , #positive^#(#neg(@x)) -> c_148() , #positive^#(#pos(@x)) -> c_149() , #positive^#(#s(@x)) -> c_150() , #natdiv^#(#0(), #0()) -> c_143() , #natdiv^#(#0(), #s(@y)) -> c_144() , #natdiv^#(#s(@x), #0()) -> c_145() , #natdiv^#(#s(@x), #s(@y)) -> c_146(#natdiv'^#(#divsub(@x, @y), #s(@y)), #divsub^#(@x, @y)) , #negative^#(#0()) -> c_151() , #negative^#(#neg(@x)) -> c_152() , #negative^#(#pos(@x)) -> c_153() , #negative^#(#s(@x)) -> c_154() , #natdiv'^#(#0(), @y) -> c_163() , #natdiv'^#(#s(@x), @y) -> c_164(#natdiv^#(#s(@x), @y)) , #natdiv'^#(#underflow(), @y) -> c_165() , #divsub^#(#0(), #0()) -> c_155() , #divsub^#(#0(), #s(@y)) -> c_156() , #divsub^#(#s(@x), #0()) -> c_157() , #divsub^#(#s(@x), #s(@y)) -> c_158(#divsub^#(@x, @y)) , #natadd^#(#0(), @y) -> c_161() , #natadd^#(#s(@x), @y) -> c_162(#natadd^#(@x, @y)) , #natsub^#(@x, #0()) -> c_166() , #natsub^#(#s(@x), #s(@y)) -> c_167(#natsub^#(@x, @y)) } Weak Trs: { #abs(#0()) -> #0() , #abs(#neg(@x)) -> #pos(@x) , #abs(#pos(@x)) -> #pos(@x) , #abs(#s(@x)) -> #pos(#s(@x)) , #equal(@x, @y) -> #eq(@x, @y) , #eq(#0(), #0()) -> #true() , #eq(#0(), #neg(@y)) -> #false() , #eq(#0(), #pos(@y)) -> #false() , #eq(#0(), #s(@y)) -> #false() , #eq(#neg(@x), #0()) -> #false() , #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #pos(@y)) -> #false() , #eq(#pos(@x), #0()) -> #false() , #eq(#pos(@x), #neg(@y)) -> #false() , #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y) , #eq(#s(@x), #0()) -> #false() , #eq(#s(@x), #s(@y)) -> #eq(@x, @y) , #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #eq(::(@x_1, @x_2), nil()) -> #false() , #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false() , #eq(nil(), ::(@y_1, @y_2)) -> #false() , #eq(nil(), nil()) -> #true() , #eq(nil(), tuple#2(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), nil()) -> #false() , #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #greater(@x, @y) -> #ckgt(#compare(@x, @y)) , #compare(#0(), #0()) -> #EQ() , #compare(#0(), #neg(@y)) -> #GT() , #compare(#0(), #pos(@y)) -> #LT() , #compare(#0(), #s(@y)) -> #LT() , #compare(#neg(@x), #0()) -> #LT() , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x) , #compare(#neg(@x), #pos(@y)) -> #LT() , #compare(#pos(@x), #0()) -> #GT() , #compare(#pos(@x), #neg(@y)) -> #GT() , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y) , #compare(#s(@x), #0()) -> #GT() , #compare(#s(@x), #s(@y)) -> #compare(@x, @y) , #ckgt(#EQ()) -> #false() , #ckgt(#GT()) -> #true() , #ckgt(#LT()) -> #false() , #less(@x, @y) -> #cklt(#compare(@x, @y)) , #cklt(#EQ()) -> #false() , #cklt(#GT()) -> #false() , #cklt(#LT()) -> #true() , *(@x, @y) -> #mult(@x, @y) , #mult(#0(), #0()) -> #0() , #mult(#0(), #neg(@y)) -> #0() , #mult(#0(), #pos(@y)) -> #0() , #mult(#neg(@x), #0()) -> #0() , #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y)) , #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #0()) -> #0() , #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y)) , +(@x, @y) -> #add(@x, @y) , #add(#0(), @y) -> @y , #add(#neg(#s(#0())), @y) -> #pred(@y) , #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y)) , #add(#pos(#s(#0())), @y) -> #succ(@y) , #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y)) , -(@x, @y) -> #sub(@x, @y) , #sub(@x, #0()) -> @x , #sub(@x, #neg(@y)) -> #add(@x, #pos(@y)) , #sub(@x, #pos(@y)) -> #add(@x, #neg(@y)) , add(@b1, @b2) -> add'(@b1, @b2, #abs(#0())) , add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r) , add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs) , add'#1(nil(), @b2, @r) -> nil() , add'#2(::(@y, @ys), @r, @x, @xs) -> add'#3(sum(@x, @y, @r), @xs, @ys) , add'#2(nil(), @r, @x, @xs) -> nil() , sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r)) , add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r')) , bitToInt(@b) -> bitToInt'(@b, #abs(#pos(#s(#0())))) , bitToInt'(@b, @n) -> bitToInt'#1(@b, @n) , bitToInt'#1(::(@x, @xs), @n) -> +(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))) , bitToInt'#1(nil(), @n) -> #abs(#0()) , compare(@b1, @b2) -> compare#1(@b1, @b2) , compare#1(::(@x, @xs), @b2) -> compare#2(@b2, @x, @xs) , compare#1(nil(), @b2) -> #abs(#0()) , compare#2(::(@y, @ys), @x, @xs) -> compare#3(compare(@xs, @ys), @x, @y) , compare#2(nil(), @x, @xs) -> #abs(#0()) , compare#3(@r, @x, @y) -> compare#4(#equal(@r, #0()), @r, @x, @y) , compare#4(#false(), @r, @x, @y) -> @r , compare#4(#true(), @r, @x, @y) -> compare#5(#less(@x, @y), @x, @y) , compare#5(#false(), @x, @y) -> compare#6(#greater(@x, @y)) , compare#5(#true(), @x, @y) -> -(#0(), #pos(#s(#0()))) , compare#6(#false()) -> #abs(#0()) , compare#6(#true()) -> #abs(#pos(#s(#0()))) , diff(@x, @y, @r) -> tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))), diff#1(#less(-(-(@x, @y), @r), #0()))) , mod(@x, @y) -> -(@x, *(@y, div(@x, @y))) , diff#1(#false()) -> #abs(#0()) , diff#1(#true()) -> #abs(#pos(#s(#0()))) , div(@x, @y) -> #div(@x, @y) , #div(#0(), #0()) -> #divByZero() , #div(#0(), #neg(@y)) -> #0() , #div(#0(), #pos(@y)) -> #0() , #div(#neg(@x), #0()) -> #divByZero() , #div(#neg(@x), #neg(@y)) -> #positive(#natdiv(@x, @y)) , #div(#neg(@x), #pos(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #0()) -> #divByZero() , #div(#pos(@x), #neg(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #pos(@y)) -> #positive(#natdiv(@x, @y)) , leq(@b1, @b2) -> #less(compare(@b1, @b2), #pos(#s(#0()))) , mult(@b1, @b2) -> mult#1(@b1, @b2) , mult#1(::(@x, @xs), @b2) -> mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x) , mult#1(nil(), @b2) -> nil() , mult#2(@zs, @b2, @x) -> mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs) , mult#3(#false(), @b2, @zs) -> @zs , mult#3(#true(), @b2, @zs) -> add(@b2, @zs) , mult3(@b1, @b2, @b3) -> mult(mult(@b1, @b2), @b2) , sub(@b1, @b2) -> sub#1(sub'(@b1, @b2, #abs(#0()))) , sub'(@b1, @b2, @r) -> sub'#1(@b1, @b2, @r) , sub#1(tuple#2(@b, @_@1)) -> @b , sub'#1(::(@x, @xs), @b2, @r) -> sub'#2(@b2, @r, @x, @xs) , sub'#1(nil(), @b2, @r) -> tuple#2(nil(), @r) , sub'#2(::(@y, @ys), @r, @x, @xs) -> sub'#3(diff(@x, @y, @r), @xs, @ys) , sub'#2(nil(), @r, @x, @xs) -> tuple#2(nil(), @r) , sub'#3(tuple#2(@z, @r'), @xs, @ys) -> sub'#4(sub'(@xs, @ys, @r'), @z) , sub'#4(tuple#2(@zs, @s), @z) -> tuple#2(sub'#5(#equal(@s, #pos(#s(#0()))), @z, @zs), @s) , sub'#5(#false(), @z, @zs) -> ::(@z, @zs) , sub'#5(#true(), @z, @zs) -> ::(#abs(#0()), @zs) , sum#1(@s) -> sum#2(#equal(@s, #0()), @s) , sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s) , sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0())) , sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0()))))) , sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0())) , sum#4(#false()) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0())))) , sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0())))) , #pred(#0()) -> #neg(#s(#0())) , #pred(#neg(#s(@x))) -> #neg(#s(#s(@x))) , #pred(#pos(#s(#0()))) -> #0() , #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x)) , #succ(#0()) -> #pos(#s(#0())) , #succ(#neg(#s(#0()))) -> #0() , #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x)) , #succ(#pos(#s(@x))) -> #pos(#s(#s(@x))) , #and(#false(), #false()) -> #false() , #and(#false(), #true()) -> #false() , #and(#true(), #false()) -> #false() , #and(#true(), #true()) -> #true() , #natdiv(#0(), #0()) -> #divByZero() , #natdiv(#0(), #s(@y)) -> #0() , #natdiv(#s(@x), #0()) -> #divByZero() , #natdiv(#s(@x), #s(@y)) -> #natdiv'(#divsub(@x, @y), #s(@y)) , #positive(#0()) -> #0() , #positive(#neg(@x)) -> #neg(@x) , #positive(#pos(@x)) -> #pos(@x) , #positive(#s(@x)) -> #pos(#s(@x)) , #negative(#0()) -> #0() , #negative(#neg(@x)) -> #pos(@x) , #negative(#pos(@x)) -> #neg(@x) , #negative(#s(@x)) -> #neg(#s(@x)) , #divsub(#0(), #0()) -> #0() , #divsub(#0(), #s(@y)) -> #underflow() , #divsub(#s(@x), #0()) -> #s(@x) , #divsub(#s(@x), #s(@y)) -> #divsub(@x, @y) , #natmult(#0(), @y) -> #0() , #natmult(#s(@x), @y) -> #natadd(@y, #natmult(@x, @y)) , #natadd(#0(), @y) -> @y , #natadd(#s(@x), @y) -> #s(#natadd(@x, @y)) , #natdiv'(#0(), @y) -> #s(#0()) , #natdiv'(#s(@x), @y) -> #s(#natdiv(#s(@x), @y)) , #natdiv'(#underflow(), @y) -> #0() , #natsub(@x, #0()) -> @x , #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^2)) The following weak DPs constitute a sub-graph of the DG that is closed under successors. The DPs are removed. { #abs^#(#0()) -> c_1() , #abs^#(#pos(@x)) -> c_3() , #equal^#(@x, @y) -> c_5(#eq^#(@x, @y)) , #eq^#(#0(), #0()) -> c_66() , #eq^#(#0(), #neg(@y)) -> c_67() , #eq^#(#0(), #pos(@y)) -> c_68() , #eq^#(#0(), #s(@y)) -> c_69() , #eq^#(#neg(@x), #0()) -> c_70() , #eq^#(#neg(@x), #neg(@y)) -> c_71(#eq^#(@x, @y)) , #eq^#(#neg(@x), #pos(@y)) -> c_72() , #eq^#(#pos(@x), #0()) -> c_73() , #eq^#(#pos(@x), #neg(@y)) -> c_74() , #eq^#(#pos(@x), #pos(@y)) -> c_75(#eq^#(@x, @y)) , #eq^#(#s(@x), #0()) -> c_76() , #eq^#(#s(@x), #s(@y)) -> c_77(#eq^#(@x, @y)) , #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) -> c_78(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)), #eq^#(@x_1, @y_1), #eq^#(@x_2, @y_2)) , #eq^#(::(@x_1, @x_2), nil()) -> c_79() , #eq^#(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> c_80() , #eq^#(nil(), ::(@y_1, @y_2)) -> c_81() , #eq^#(nil(), nil()) -> c_82() , #eq^#(nil(), tuple#2(@y_1, @y_2)) -> c_83() , #eq^#(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> c_84() , #eq^#(tuple#2(@x_1, @x_2), nil()) -> c_85() , #eq^#(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> c_86(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)), #eq^#(@x_1, @y_1), #eq^#(@x_2, @y_2)) , #greater^#(@x, @y) -> c_6(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y)) , #ckgt^#(#EQ()) -> c_99() , #ckgt^#(#GT()) -> c_100() , #ckgt^#(#LT()) -> c_101() , #compare^#(#0(), #0()) -> c_87() , #compare^#(#0(), #neg(@y)) -> c_88() , #compare^#(#0(), #pos(@y)) -> c_89() , #compare^#(#0(), #s(@y)) -> c_90() , #compare^#(#neg(@x), #0()) -> c_91() , #compare^#(#neg(@x), #neg(@y)) -> c_92(#compare^#(@y, @x)) , #compare^#(#neg(@x), #pos(@y)) -> c_93() , #compare^#(#pos(@x), #0()) -> c_94() , #compare^#(#pos(@x), #neg(@y)) -> c_95() , #compare^#(#pos(@x), #pos(@y)) -> c_96(#compare^#(@x, @y)) , #compare^#(#s(@x), #0()) -> c_97() , #compare^#(#s(@x), #s(@y)) -> c_98(#compare^#(@x, @y)) , #less^#(@x, @y) -> c_7(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y)) , #cklt^#(#EQ()) -> c_102() , #cklt^#(#GT()) -> c_103() , #cklt^#(#LT()) -> c_104() , *^#(@x, @y) -> c_8(#mult^#(@x, @y)) , #mult^#(#0(), #0()) -> c_105() , #mult^#(#0(), #neg(@y)) -> c_106() , #mult^#(#0(), #pos(@y)) -> c_107() , #mult^#(#neg(@x), #0()) -> c_108() , #mult^#(#neg(@x), #neg(@y)) -> c_109(#natmult^#(@x, @y)) , #mult^#(#neg(@x), #pos(@y)) -> c_110(#natmult^#(@x, @y)) , #mult^#(#pos(@x), #0()) -> c_111() , #mult^#(#pos(@x), #neg(@y)) -> c_112(#natmult^#(@x, @y)) , #mult^#(#pos(@x), #pos(@y)) -> c_113(#natmult^#(@x, @y)) , +^#(@x, @y) -> c_9(#add^#(@x, @y)) , #add^#(#0(), @y) -> c_114() , #add^#(#neg(#s(#0())), @y) -> c_115(#pred^#(@y)) , #add^#(#neg(#s(#s(@x))), @y) -> c_116(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) , #add^#(#pos(#s(#0())), @y) -> c_117(#succ^#(@y)) , #add^#(#pos(#s(#s(@x))), @y) -> c_118(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) , -^#(@x, @y) -> c_10(#sub^#(@x, @y)) , #sub^#(@x, #0()) -> c_119() , #sub^#(@x, #neg(@y)) -> c_120(#add^#(@x, #pos(@y))) , #sub^#(@x, #pos(@y)) -> c_121(#add^#(@x, #neg(@y))) , add'#1^#(nil(), @b2, @r) -> c_14() , add'#2^#(nil(), @r, @x, @xs) -> c_16() , sum^#(@x, @y, @r) -> c_17(sum#1^#(+(+(@x, @y), @r)), +^#(+(@x, @y), @r), +^#(@x, @y)) , sum#1^#(@s) -> c_59(sum#2^#(#equal(@s, #0()), @s), #equal^#(@s, #0())) , bitToInt'#1^#(nil(), @n) -> c_22(#abs^#(#0())) , compare#1^#(nil(), @b2) -> c_25(#abs^#(#0())) , compare#2^#(nil(), @x, @xs) -> c_27(#abs^#(#0())) , compare#3^#(@r, @x, @y) -> c_28(compare#4^#(#equal(@r, #0()), @r, @x, @y), #equal^#(@r, #0())) , compare#4^#(#false(), @r, @x, @y) -> c_29() , compare#4^#(#true(), @r, @x, @y) -> c_30(compare#5^#(#less(@x, @y), @x, @y), #less^#(@x, @y)) , compare#5^#(#false(), @x, @y) -> c_31(compare#6^#(#greater(@x, @y)), #greater^#(@x, @y)) , compare#5^#(#true(), @x, @y) -> c_32(-^#(#0(), #pos(#s(#0())))) , compare#6^#(#false()) -> c_33(#abs^#(#0())) , compare#6^#(#true()) -> c_34(#abs^#(#pos(#s(#0())))) , diff^#(@x, @y, @r) -> c_35(mod^#(+(+(@x, @y), @r), #pos(#s(#s(#0())))), +^#(+(@x, @y), @r), +^#(@x, @y), diff#1^#(#less(-(-(@x, @y), @r), #0())), #less^#(-(-(@x, @y), @r), #0()), -^#(-(@x, @y), @r), -^#(@x, @y)) , mod^#(@x, @y) -> c_36(-^#(@x, *(@y, div(@x, @y))), *^#(@y, div(@x, @y)), div^#(@x, @y)) , diff#1^#(#false()) -> c_37(#abs^#(#0())) , diff#1^#(#true()) -> c_38(#abs^#(#pos(#s(#0())))) , div^#(@x, @y) -> c_39(#div^#(@x, @y)) , #div^#(#0(), #0()) -> c_122() , #div^#(#0(), #neg(@y)) -> c_123() , #div^#(#0(), #pos(@y)) -> c_124() , #div^#(#neg(@x), #0()) -> c_125() , #div^#(#neg(@x), #neg(@y)) -> c_126(#positive^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) , #div^#(#neg(@x), #pos(@y)) -> c_127(#negative^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) , #div^#(#pos(@x), #0()) -> c_128() , #div^#(#pos(@x), #neg(@y)) -> c_129(#negative^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) , #div^#(#pos(@x), #pos(@y)) -> c_130(#positive^#(#natdiv(@x, @y)), #natdiv^#(@x, @y)) , mult#1^#(nil(), @b2) -> c_43() , mult#3^#(#false(), @b2, @zs) -> c_45() , sub#1^#(tuple#2(@b, @_@1)) -> c_50() , sub'#1^#(nil(), @b2, @r) -> c_52() , sub'#2^#(nil(), @r, @x, @xs) -> c_54() , sub'#4^#(tuple#2(@zs, @s), @z) -> c_56(sub'#5^#(#equal(@s, #pos(#s(#0()))), @z, @zs), #equal^#(@s, #pos(#s(#0())))) , sub'#5^#(#false(), @z, @zs) -> c_57() , sub'#5^#(#true(), @z, @zs) -> c_58(#abs^#(#0())) , sum#2^#(#false(), @s) -> c_60(sum#3^#(#equal(@s, #pos(#s(#0()))), @s), #equal^#(@s, #pos(#s(#0())))) , sum#2^#(#true(), @s) -> c_61(#abs^#(#0()), #abs^#(#0())) , sum#3^#(#false(), @s) -> c_62(sum#4^#(#equal(@s, #pos(#s(#s(#0()))))), #equal^#(@s, #pos(#s(#s(#0()))))) , sum#3^#(#true(), @s) -> c_63(#abs^#(#pos(#s(#0()))), #abs^#(#0())) , sum#4^#(#false()) -> c_64(#abs^#(#pos(#s(#0()))), #abs^#(#pos(#s(#0())))) , sum#4^#(#true()) -> c_65(#abs^#(#0()), #abs^#(#pos(#s(#0())))) , #and^#(#false(), #false()) -> c_139() , #and^#(#false(), #true()) -> c_140() , #and^#(#true(), #false()) -> c_141() , #and^#(#true(), #true()) -> c_142() , #natmult^#(#0(), @y) -> c_159() , #natmult^#(#s(@x), @y) -> c_160(#natadd^#(@y, #natmult(@x, @y)), #natmult^#(@x, @y)) , #pred^#(#0()) -> c_131() , #pred^#(#neg(#s(@x))) -> c_132() , #pred^#(#pos(#s(#0()))) -> c_133() , #pred^#(#pos(#s(#s(@x)))) -> c_134() , #succ^#(#0()) -> c_135() , #succ^#(#neg(#s(#0()))) -> c_136() , #succ^#(#neg(#s(#s(@x)))) -> c_137() , #succ^#(#pos(#s(@x))) -> c_138() , #positive^#(#0()) -> c_147() , #positive^#(#neg(@x)) -> c_148() , #positive^#(#pos(@x)) -> c_149() , #positive^#(#s(@x)) -> c_150() , #natdiv^#(#0(), #0()) -> c_143() , #natdiv^#(#0(), #s(@y)) -> c_144() , #natdiv^#(#s(@x), #0()) -> c_145() , #natdiv^#(#s(@x), #s(@y)) -> c_146(#natdiv'^#(#divsub(@x, @y), #s(@y)), #divsub^#(@x, @y)) , #negative^#(#0()) -> c_151() , #negative^#(#neg(@x)) -> c_152() , #negative^#(#pos(@x)) -> c_153() , #negative^#(#s(@x)) -> c_154() , #natdiv'^#(#0(), @y) -> c_163() , #natdiv'^#(#s(@x), @y) -> c_164(#natdiv^#(#s(@x), @y)) , #natdiv'^#(#underflow(), @y) -> c_165() , #divsub^#(#0(), #0()) -> c_155() , #divsub^#(#0(), #s(@y)) -> c_156() , #divsub^#(#s(@x), #0()) -> c_157() , #divsub^#(#s(@x), #s(@y)) -> c_158(#divsub^#(@x, @y)) , #natadd^#(#0(), @y) -> c_161() , #natadd^#(#s(@x), @y) -> c_162(#natadd^#(@x, @y)) , #natsub^#(@x, #0()) -> c_166() , #natsub^#(#s(@x), #s(@y)) -> c_167(#natsub^#(@x, @y)) } We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^2)). Strict DPs: { add^#(@b1, @b2) -> c_11(add'^#(@b1, @b2, #abs(#0())), #abs^#(#0())) , add'^#(@b1, @b2, @r) -> c_12(add'#1^#(@b1, @b2, @r)) , add'#1^#(::(@x, @xs), @b2, @r) -> c_13(add'#2^#(@b2, @r, @x, @xs)) , add'#2^#(::(@y, @ys), @r, @x, @xs) -> c_15(add'#3^#(sum(@x, @y, @r), @xs, @ys), sum^#(@x, @y, @r)) , add'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_18(add'^#(@xs, @ys, @r')) , bitToInt^#(@b) -> c_19(bitToInt'^#(@b, #abs(#pos(#s(#0())))), #abs^#(#pos(#s(#0())))) , bitToInt'^#(@b, @n) -> c_20(bitToInt'#1^#(@b, @n)) , bitToInt'#1^#(::(@x, @xs), @n) -> c_21(+^#(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))), *^#(@x, @n), bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))), *^#(@n, #pos(#s(#s(#0()))))) , compare^#(@b1, @b2) -> c_23(compare#1^#(@b1, @b2)) , compare#1^#(::(@x, @xs), @b2) -> c_24(compare#2^#(@b2, @x, @xs)) , compare#2^#(::(@y, @ys), @x, @xs) -> c_26(compare#3^#(compare(@xs, @ys), @x, @y), compare^#(@xs, @ys)) , leq^#(@b1, @b2) -> c_40(#less^#(compare(@b1, @b2), #pos(#s(#0()))), compare^#(@b1, @b2)) , mult^#(@b1, @b2) -> c_41(mult#1^#(@b1, @b2)) , mult#1^#(::(@x, @xs), @b2) -> c_42(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x), #abs^#(#0()), mult^#(@xs, @b2)) , mult#2^#(@zs, @b2, @x) -> c_44(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs), #equal^#(@x, #pos(#s(#0())))) , mult#3^#(#true(), @b2, @zs) -> c_46(add^#(@b2, @zs)) , mult3^#(@b1, @b2, @b3) -> c_47(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2)) , sub^#(@b1, @b2) -> c_48(sub#1^#(sub'(@b1, @b2, #abs(#0()))), sub'^#(@b1, @b2, #abs(#0())), #abs^#(#0())) , sub'^#(@b1, @b2, @r) -> c_49(sub'#1^#(@b1, @b2, @r)) , sub'#1^#(::(@x, @xs), @b2, @r) -> c_51(sub'#2^#(@b2, @r, @x, @xs)) , sub'#2^#(::(@y, @ys), @r, @x, @xs) -> c_53(sub'#3^#(diff(@x, @y, @r), @xs, @ys), diff^#(@x, @y, @r)) , sub'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_55(sub'#4^#(sub'(@xs, @ys, @r'), @z), sub'^#(@xs, @ys, @r')) } Weak Trs: { #abs(#0()) -> #0() , #abs(#neg(@x)) -> #pos(@x) , #abs(#pos(@x)) -> #pos(@x) , #abs(#s(@x)) -> #pos(#s(@x)) , #equal(@x, @y) -> #eq(@x, @y) , #eq(#0(), #0()) -> #true() , #eq(#0(), #neg(@y)) -> #false() , #eq(#0(), #pos(@y)) -> #false() , #eq(#0(), #s(@y)) -> #false() , #eq(#neg(@x), #0()) -> #false() , #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #pos(@y)) -> #false() , #eq(#pos(@x), #0()) -> #false() , #eq(#pos(@x), #neg(@y)) -> #false() , #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y) , #eq(#s(@x), #0()) -> #false() , #eq(#s(@x), #s(@y)) -> #eq(@x, @y) , #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #eq(::(@x_1, @x_2), nil()) -> #false() , #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false() , #eq(nil(), ::(@y_1, @y_2)) -> #false() , #eq(nil(), nil()) -> #true() , #eq(nil(), tuple#2(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), nil()) -> #false() , #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #greater(@x, @y) -> #ckgt(#compare(@x, @y)) , #compare(#0(), #0()) -> #EQ() , #compare(#0(), #neg(@y)) -> #GT() , #compare(#0(), #pos(@y)) -> #LT() , #compare(#0(), #s(@y)) -> #LT() , #compare(#neg(@x), #0()) -> #LT() , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x) , #compare(#neg(@x), #pos(@y)) -> #LT() , #compare(#pos(@x), #0()) -> #GT() , #compare(#pos(@x), #neg(@y)) -> #GT() , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y) , #compare(#s(@x), #0()) -> #GT() , #compare(#s(@x), #s(@y)) -> #compare(@x, @y) , #ckgt(#EQ()) -> #false() , #ckgt(#GT()) -> #true() , #ckgt(#LT()) -> #false() , #less(@x, @y) -> #cklt(#compare(@x, @y)) , #cklt(#EQ()) -> #false() , #cklt(#GT()) -> #false() , #cklt(#LT()) -> #true() , *(@x, @y) -> #mult(@x, @y) , #mult(#0(), #0()) -> #0() , #mult(#0(), #neg(@y)) -> #0() , #mult(#0(), #pos(@y)) -> #0() , #mult(#neg(@x), #0()) -> #0() , #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y)) , #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #0()) -> #0() , #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y)) , +(@x, @y) -> #add(@x, @y) , #add(#0(), @y) -> @y , #add(#neg(#s(#0())), @y) -> #pred(@y) , #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y)) , #add(#pos(#s(#0())), @y) -> #succ(@y) , #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y)) , -(@x, @y) -> #sub(@x, @y) , #sub(@x, #0()) -> @x , #sub(@x, #neg(@y)) -> #add(@x, #pos(@y)) , #sub(@x, #pos(@y)) -> #add(@x, #neg(@y)) , add(@b1, @b2) -> add'(@b1, @b2, #abs(#0())) , add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r) , add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs) , add'#1(nil(), @b2, @r) -> nil() , add'#2(::(@y, @ys), @r, @x, @xs) -> add'#3(sum(@x, @y, @r), @xs, @ys) , add'#2(nil(), @r, @x, @xs) -> nil() , sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r)) , add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r')) , bitToInt(@b) -> bitToInt'(@b, #abs(#pos(#s(#0())))) , bitToInt'(@b, @n) -> bitToInt'#1(@b, @n) , bitToInt'#1(::(@x, @xs), @n) -> +(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))) , bitToInt'#1(nil(), @n) -> #abs(#0()) , compare(@b1, @b2) -> compare#1(@b1, @b2) , compare#1(::(@x, @xs), @b2) -> compare#2(@b2, @x, @xs) , compare#1(nil(), @b2) -> #abs(#0()) , compare#2(::(@y, @ys), @x, @xs) -> compare#3(compare(@xs, @ys), @x, @y) , compare#2(nil(), @x, @xs) -> #abs(#0()) , compare#3(@r, @x, @y) -> compare#4(#equal(@r, #0()), @r, @x, @y) , compare#4(#false(), @r, @x, @y) -> @r , compare#4(#true(), @r, @x, @y) -> compare#5(#less(@x, @y), @x, @y) , compare#5(#false(), @x, @y) -> compare#6(#greater(@x, @y)) , compare#5(#true(), @x, @y) -> -(#0(), #pos(#s(#0()))) , compare#6(#false()) -> #abs(#0()) , compare#6(#true()) -> #abs(#pos(#s(#0()))) , diff(@x, @y, @r) -> tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))), diff#1(#less(-(-(@x, @y), @r), #0()))) , mod(@x, @y) -> -(@x, *(@y, div(@x, @y))) , diff#1(#false()) -> #abs(#0()) , diff#1(#true()) -> #abs(#pos(#s(#0()))) , div(@x, @y) -> #div(@x, @y) , #div(#0(), #0()) -> #divByZero() , #div(#0(), #neg(@y)) -> #0() , #div(#0(), #pos(@y)) -> #0() , #div(#neg(@x), #0()) -> #divByZero() , #div(#neg(@x), #neg(@y)) -> #positive(#natdiv(@x, @y)) , #div(#neg(@x), #pos(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #0()) -> #divByZero() , #div(#pos(@x), #neg(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #pos(@y)) -> #positive(#natdiv(@x, @y)) , leq(@b1, @b2) -> #less(compare(@b1, @b2), #pos(#s(#0()))) , mult(@b1, @b2) -> mult#1(@b1, @b2) , mult#1(::(@x, @xs), @b2) -> mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x) , mult#1(nil(), @b2) -> nil() , mult#2(@zs, @b2, @x) -> mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs) , mult#3(#false(), @b2, @zs) -> @zs , mult#3(#true(), @b2, @zs) -> add(@b2, @zs) , mult3(@b1, @b2, @b3) -> mult(mult(@b1, @b2), @b2) , sub(@b1, @b2) -> sub#1(sub'(@b1, @b2, #abs(#0()))) , sub'(@b1, @b2, @r) -> sub'#1(@b1, @b2, @r) , sub#1(tuple#2(@b, @_@1)) -> @b , sub'#1(::(@x, @xs), @b2, @r) -> sub'#2(@b2, @r, @x, @xs) , sub'#1(nil(), @b2, @r) -> tuple#2(nil(), @r) , sub'#2(::(@y, @ys), @r, @x, @xs) -> sub'#3(diff(@x, @y, @r), @xs, @ys) , sub'#2(nil(), @r, @x, @xs) -> tuple#2(nil(), @r) , sub'#3(tuple#2(@z, @r'), @xs, @ys) -> sub'#4(sub'(@xs, @ys, @r'), @z) , sub'#4(tuple#2(@zs, @s), @z) -> tuple#2(sub'#5(#equal(@s, #pos(#s(#0()))), @z, @zs), @s) , sub'#5(#false(), @z, @zs) -> ::(@z, @zs) , sub'#5(#true(), @z, @zs) -> ::(#abs(#0()), @zs) , sum#1(@s) -> sum#2(#equal(@s, #0()), @s) , sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s) , sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0())) , sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0()))))) , sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0())) , sum#4(#false()) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0())))) , sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0())))) , #pred(#0()) -> #neg(#s(#0())) , #pred(#neg(#s(@x))) -> #neg(#s(#s(@x))) , #pred(#pos(#s(#0()))) -> #0() , #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x)) , #succ(#0()) -> #pos(#s(#0())) , #succ(#neg(#s(#0()))) -> #0() , #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x)) , #succ(#pos(#s(@x))) -> #pos(#s(#s(@x))) , #and(#false(), #false()) -> #false() , #and(#false(), #true()) -> #false() , #and(#true(), #false()) -> #false() , #and(#true(), #true()) -> #true() , #natdiv(#0(), #0()) -> #divByZero() , #natdiv(#0(), #s(@y)) -> #0() , #natdiv(#s(@x), #0()) -> #divByZero() , #natdiv(#s(@x), #s(@y)) -> #natdiv'(#divsub(@x, @y), #s(@y)) , #positive(#0()) -> #0() , #positive(#neg(@x)) -> #neg(@x) , #positive(#pos(@x)) -> #pos(@x) , #positive(#s(@x)) -> #pos(#s(@x)) , #negative(#0()) -> #0() , #negative(#neg(@x)) -> #pos(@x) , #negative(#pos(@x)) -> #neg(@x) , #negative(#s(@x)) -> #neg(#s(@x)) , #divsub(#0(), #0()) -> #0() , #divsub(#0(), #s(@y)) -> #underflow() , #divsub(#s(@x), #0()) -> #s(@x) , #divsub(#s(@x), #s(@y)) -> #divsub(@x, @y) , #natmult(#0(), @y) -> #0() , #natmult(#s(@x), @y) -> #natadd(@y, #natmult(@x, @y)) , #natadd(#0(), @y) -> @y , #natadd(#s(@x), @y) -> #s(#natadd(@x, @y)) , #natdiv'(#0(), @y) -> #s(#0()) , #natdiv'(#s(@x), @y) -> #s(#natdiv(#s(@x), @y)) , #natdiv'(#underflow(), @y) -> #0() , #natsub(@x, #0()) -> @x , #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^2)) Due to missing edges in the dependency-graph, the right-hand sides of following rules could be simplified: { add^#(@b1, @b2) -> c_11(add'^#(@b1, @b2, #abs(#0())), #abs^#(#0())) , add'#2^#(::(@y, @ys), @r, @x, @xs) -> c_15(add'#3^#(sum(@x, @y, @r), @xs, @ys), sum^#(@x, @y, @r)) , bitToInt^#(@b) -> c_19(bitToInt'^#(@b, #abs(#pos(#s(#0())))), #abs^#(#pos(#s(#0())))) , bitToInt'#1^#(::(@x, @xs), @n) -> c_21(+^#(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))), *^#(@x, @n), bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))), *^#(@n, #pos(#s(#s(#0()))))) , compare#2^#(::(@y, @ys), @x, @xs) -> c_26(compare#3^#(compare(@xs, @ys), @x, @y), compare^#(@xs, @ys)) , leq^#(@b1, @b2) -> c_40(#less^#(compare(@b1, @b2), #pos(#s(#0()))), compare^#(@b1, @b2)) , mult#1^#(::(@x, @xs), @b2) -> c_42(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x), #abs^#(#0()), mult^#(@xs, @b2)) , mult#2^#(@zs, @b2, @x) -> c_44(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs), #equal^#(@x, #pos(#s(#0())))) , sub^#(@b1, @b2) -> c_48(sub#1^#(sub'(@b1, @b2, #abs(#0()))), sub'^#(@b1, @b2, #abs(#0())), #abs^#(#0())) , sub'#2^#(::(@y, @ys), @r, @x, @xs) -> c_53(sub'#3^#(diff(@x, @y, @r), @xs, @ys), diff^#(@x, @y, @r)) , sub'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_55(sub'#4^#(sub'(@xs, @ys, @r'), @z), sub'^#(@xs, @ys, @r')) } We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^2)). Strict DPs: { add^#(@b1, @b2) -> c_1(add'^#(@b1, @b2, #abs(#0()))) , add'^#(@b1, @b2, @r) -> c_2(add'#1^#(@b1, @b2, @r)) , add'#1^#(::(@x, @xs), @b2, @r) -> c_3(add'#2^#(@b2, @r, @x, @xs)) , add'#2^#(::(@y, @ys), @r, @x, @xs) -> c_4(add'#3^#(sum(@x, @y, @r), @xs, @ys)) , add'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_5(add'^#(@xs, @ys, @r')) , bitToInt^#(@b) -> c_6(bitToInt'^#(@b, #abs(#pos(#s(#0()))))) , bitToInt'^#(@b, @n) -> c_7(bitToInt'#1^#(@b, @n)) , bitToInt'#1^#(::(@x, @xs), @n) -> c_8(bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0())))))) , compare^#(@b1, @b2) -> c_9(compare#1^#(@b1, @b2)) , compare#1^#(::(@x, @xs), @b2) -> c_10(compare#2^#(@b2, @x, @xs)) , compare#2^#(::(@y, @ys), @x, @xs) -> c_11(compare^#(@xs, @ys)) , leq^#(@b1, @b2) -> c_12(compare^#(@b1, @b2)) , mult^#(@b1, @b2) -> c_13(mult#1^#(@b1, @b2)) , mult#1^#(::(@x, @xs), @b2) -> c_14(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x), mult^#(@xs, @b2)) , mult#2^#(@zs, @b2, @x) -> c_15(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs)) , mult#3^#(#true(), @b2, @zs) -> c_16(add^#(@b2, @zs)) , mult3^#(@b1, @b2, @b3) -> c_17(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2)) , sub^#(@b1, @b2) -> c_18(sub'^#(@b1, @b2, #abs(#0()))) , sub'^#(@b1, @b2, @r) -> c_19(sub'#1^#(@b1, @b2, @r)) , sub'#1^#(::(@x, @xs), @b2, @r) -> c_20(sub'#2^#(@b2, @r, @x, @xs)) , sub'#2^#(::(@y, @ys), @r, @x, @xs) -> c_21(sub'#3^#(diff(@x, @y, @r), @xs, @ys)) , sub'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_22(sub'^#(@xs, @ys, @r')) } Weak Trs: { #abs(#0()) -> #0() , #abs(#neg(@x)) -> #pos(@x) , #abs(#pos(@x)) -> #pos(@x) , #abs(#s(@x)) -> #pos(#s(@x)) , #equal(@x, @y) -> #eq(@x, @y) , #eq(#0(), #0()) -> #true() , #eq(#0(), #neg(@y)) -> #false() , #eq(#0(), #pos(@y)) -> #false() , #eq(#0(), #s(@y)) -> #false() , #eq(#neg(@x), #0()) -> #false() , #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #pos(@y)) -> #false() , #eq(#pos(@x), #0()) -> #false() , #eq(#pos(@x), #neg(@y)) -> #false() , #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y) , #eq(#s(@x), #0()) -> #false() , #eq(#s(@x), #s(@y)) -> #eq(@x, @y) , #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #eq(::(@x_1, @x_2), nil()) -> #false() , #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false() , #eq(nil(), ::(@y_1, @y_2)) -> #false() , #eq(nil(), nil()) -> #true() , #eq(nil(), tuple#2(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), nil()) -> #false() , #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #greater(@x, @y) -> #ckgt(#compare(@x, @y)) , #compare(#0(), #0()) -> #EQ() , #compare(#0(), #neg(@y)) -> #GT() , #compare(#0(), #pos(@y)) -> #LT() , #compare(#0(), #s(@y)) -> #LT() , #compare(#neg(@x), #0()) -> #LT() , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x) , #compare(#neg(@x), #pos(@y)) -> #LT() , #compare(#pos(@x), #0()) -> #GT() , #compare(#pos(@x), #neg(@y)) -> #GT() , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y) , #compare(#s(@x), #0()) -> #GT() , #compare(#s(@x), #s(@y)) -> #compare(@x, @y) , #ckgt(#EQ()) -> #false() , #ckgt(#GT()) -> #true() , #ckgt(#LT()) -> #false() , #less(@x, @y) -> #cklt(#compare(@x, @y)) , #cklt(#EQ()) -> #false() , #cklt(#GT()) -> #false() , #cklt(#LT()) -> #true() , *(@x, @y) -> #mult(@x, @y) , #mult(#0(), #0()) -> #0() , #mult(#0(), #neg(@y)) -> #0() , #mult(#0(), #pos(@y)) -> #0() , #mult(#neg(@x), #0()) -> #0() , #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y)) , #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #0()) -> #0() , #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y)) , +(@x, @y) -> #add(@x, @y) , #add(#0(), @y) -> @y , #add(#neg(#s(#0())), @y) -> #pred(@y) , #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y)) , #add(#pos(#s(#0())), @y) -> #succ(@y) , #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y)) , -(@x, @y) -> #sub(@x, @y) , #sub(@x, #0()) -> @x , #sub(@x, #neg(@y)) -> #add(@x, #pos(@y)) , #sub(@x, #pos(@y)) -> #add(@x, #neg(@y)) , add(@b1, @b2) -> add'(@b1, @b2, #abs(#0())) , add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r) , add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs) , add'#1(nil(), @b2, @r) -> nil() , add'#2(::(@y, @ys), @r, @x, @xs) -> add'#3(sum(@x, @y, @r), @xs, @ys) , add'#2(nil(), @r, @x, @xs) -> nil() , sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r)) , add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r')) , bitToInt(@b) -> bitToInt'(@b, #abs(#pos(#s(#0())))) , bitToInt'(@b, @n) -> bitToInt'#1(@b, @n) , bitToInt'#1(::(@x, @xs), @n) -> +(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))) , bitToInt'#1(nil(), @n) -> #abs(#0()) , compare(@b1, @b2) -> compare#1(@b1, @b2) , compare#1(::(@x, @xs), @b2) -> compare#2(@b2, @x, @xs) , compare#1(nil(), @b2) -> #abs(#0()) , compare#2(::(@y, @ys), @x, @xs) -> compare#3(compare(@xs, @ys), @x, @y) , compare#2(nil(), @x, @xs) -> #abs(#0()) , compare#3(@r, @x, @y) -> compare#4(#equal(@r, #0()), @r, @x, @y) , compare#4(#false(), @r, @x, @y) -> @r , compare#4(#true(), @r, @x, @y) -> compare#5(#less(@x, @y), @x, @y) , compare#5(#false(), @x, @y) -> compare#6(#greater(@x, @y)) , compare#5(#true(), @x, @y) -> -(#0(), #pos(#s(#0()))) , compare#6(#false()) -> #abs(#0()) , compare#6(#true()) -> #abs(#pos(#s(#0()))) , diff(@x, @y, @r) -> tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))), diff#1(#less(-(-(@x, @y), @r), #0()))) , mod(@x, @y) -> -(@x, *(@y, div(@x, @y))) , diff#1(#false()) -> #abs(#0()) , diff#1(#true()) -> #abs(#pos(#s(#0()))) , div(@x, @y) -> #div(@x, @y) , #div(#0(), #0()) -> #divByZero() , #div(#0(), #neg(@y)) -> #0() , #div(#0(), #pos(@y)) -> #0() , #div(#neg(@x), #0()) -> #divByZero() , #div(#neg(@x), #neg(@y)) -> #positive(#natdiv(@x, @y)) , #div(#neg(@x), #pos(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #0()) -> #divByZero() , #div(#pos(@x), #neg(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #pos(@y)) -> #positive(#natdiv(@x, @y)) , leq(@b1, @b2) -> #less(compare(@b1, @b2), #pos(#s(#0()))) , mult(@b1, @b2) -> mult#1(@b1, @b2) , mult#1(::(@x, @xs), @b2) -> mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x) , mult#1(nil(), @b2) -> nil() , mult#2(@zs, @b2, @x) -> mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs) , mult#3(#false(), @b2, @zs) -> @zs , mult#3(#true(), @b2, @zs) -> add(@b2, @zs) , mult3(@b1, @b2, @b3) -> mult(mult(@b1, @b2), @b2) , sub(@b1, @b2) -> sub#1(sub'(@b1, @b2, #abs(#0()))) , sub'(@b1, @b2, @r) -> sub'#1(@b1, @b2, @r) , sub#1(tuple#2(@b, @_@1)) -> @b , sub'#1(::(@x, @xs), @b2, @r) -> sub'#2(@b2, @r, @x, @xs) , sub'#1(nil(), @b2, @r) -> tuple#2(nil(), @r) , sub'#2(::(@y, @ys), @r, @x, @xs) -> sub'#3(diff(@x, @y, @r), @xs, @ys) , sub'#2(nil(), @r, @x, @xs) -> tuple#2(nil(), @r) , sub'#3(tuple#2(@z, @r'), @xs, @ys) -> sub'#4(sub'(@xs, @ys, @r'), @z) , sub'#4(tuple#2(@zs, @s), @z) -> tuple#2(sub'#5(#equal(@s, #pos(#s(#0()))), @z, @zs), @s) , sub'#5(#false(), @z, @zs) -> ::(@z, @zs) , sub'#5(#true(), @z, @zs) -> ::(#abs(#0()), @zs) , sum#1(@s) -> sum#2(#equal(@s, #0()), @s) , sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s) , sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0())) , sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0()))))) , sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0())) , sum#4(#false()) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0())))) , sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0())))) , #pred(#0()) -> #neg(#s(#0())) , #pred(#neg(#s(@x))) -> #neg(#s(#s(@x))) , #pred(#pos(#s(#0()))) -> #0() , #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x)) , #succ(#0()) -> #pos(#s(#0())) , #succ(#neg(#s(#0()))) -> #0() , #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x)) , #succ(#pos(#s(@x))) -> #pos(#s(#s(@x))) , #and(#false(), #false()) -> #false() , #and(#false(), #true()) -> #false() , #and(#true(), #false()) -> #false() , #and(#true(), #true()) -> #true() , #natdiv(#0(), #0()) -> #divByZero() , #natdiv(#0(), #s(@y)) -> #0() , #natdiv(#s(@x), #0()) -> #divByZero() , #natdiv(#s(@x), #s(@y)) -> #natdiv'(#divsub(@x, @y), #s(@y)) , #positive(#0()) -> #0() , #positive(#neg(@x)) -> #neg(@x) , #positive(#pos(@x)) -> #pos(@x) , #positive(#s(@x)) -> #pos(#s(@x)) , #negative(#0()) -> #0() , #negative(#neg(@x)) -> #pos(@x) , #negative(#pos(@x)) -> #neg(@x) , #negative(#s(@x)) -> #neg(#s(@x)) , #divsub(#0(), #0()) -> #0() , #divsub(#0(), #s(@y)) -> #underflow() , #divsub(#s(@x), #0()) -> #s(@x) , #divsub(#s(@x), #s(@y)) -> #divsub(@x, @y) , #natmult(#0(), @y) -> #0() , #natmult(#s(@x), @y) -> #natadd(@y, #natmult(@x, @y)) , #natadd(#0(), @y) -> @y , #natadd(#s(@x), @y) -> #s(#natadd(@x, @y)) , #natdiv'(#0(), @y) -> #s(#0()) , #natdiv'(#s(@x), @y) -> #s(#natdiv(#s(@x), @y)) , #natdiv'(#underflow(), @y) -> #0() , #natsub(@x, #0()) -> @x , #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^2)) We analyse the complexity of following sub-problems (R) and (S). Problem (S) is obtained from the input problem by shifting strict rules from (R) into the weak component: Problem (R): ------------ Strict DPs: { add^#(@b1, @b2) -> c_1(add'^#(@b1, @b2, #abs(#0()))) , add'^#(@b1, @b2, @r) -> c_2(add'#1^#(@b1, @b2, @r)) , add'#1^#(::(@x, @xs), @b2, @r) -> c_3(add'#2^#(@b2, @r, @x, @xs)) , add'#2^#(::(@y, @ys), @r, @x, @xs) -> c_4(add'#3^#(sum(@x, @y, @r), @xs, @ys)) , add'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_5(add'^#(@xs, @ys, @r')) , mult^#(@b1, @b2) -> c_13(mult#1^#(@b1, @b2)) , mult#1^#(::(@x, @xs), @b2) -> c_14(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x), mult^#(@xs, @b2)) , mult#2^#(@zs, @b2, @x) -> c_15(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs)) , mult#3^#(#true(), @b2, @zs) -> c_16(add^#(@b2, @zs)) , mult3^#(@b1, @b2, @b3) -> c_17(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2)) } Weak DPs: { bitToInt^#(@b) -> c_6(bitToInt'^#(@b, #abs(#pos(#s(#0()))))) , bitToInt'^#(@b, @n) -> c_7(bitToInt'#1^#(@b, @n)) , bitToInt'#1^#(::(@x, @xs), @n) -> c_8(bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0())))))) , compare^#(@b1, @b2) -> c_9(compare#1^#(@b1, @b2)) , compare#1^#(::(@x, @xs), @b2) -> c_10(compare#2^#(@b2, @x, @xs)) , compare#2^#(::(@y, @ys), @x, @xs) -> c_11(compare^#(@xs, @ys)) , leq^#(@b1, @b2) -> c_12(compare^#(@b1, @b2)) , sub^#(@b1, @b2) -> c_18(sub'^#(@b1, @b2, #abs(#0()))) , sub'^#(@b1, @b2, @r) -> c_19(sub'#1^#(@b1, @b2, @r)) , sub'#1^#(::(@x, @xs), @b2, @r) -> c_20(sub'#2^#(@b2, @r, @x, @xs)) , sub'#2^#(::(@y, @ys), @r, @x, @xs) -> c_21(sub'#3^#(diff(@x, @y, @r), @xs, @ys)) , sub'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_22(sub'^#(@xs, @ys, @r')) } Weak Trs: { #abs(#0()) -> #0() , #abs(#neg(@x)) -> #pos(@x) , #abs(#pos(@x)) -> #pos(@x) , #abs(#s(@x)) -> #pos(#s(@x)) , #equal(@x, @y) -> #eq(@x, @y) , #eq(#0(), #0()) -> #true() , #eq(#0(), #neg(@y)) -> #false() , #eq(#0(), #pos(@y)) -> #false() , #eq(#0(), #s(@y)) -> #false() , #eq(#neg(@x), #0()) -> #false() , #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #pos(@y)) -> #false() , #eq(#pos(@x), #0()) -> #false() , #eq(#pos(@x), #neg(@y)) -> #false() , #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y) , #eq(#s(@x), #0()) -> #false() , #eq(#s(@x), #s(@y)) -> #eq(@x, @y) , #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #eq(::(@x_1, @x_2), nil()) -> #false() , #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false() , #eq(nil(), ::(@y_1, @y_2)) -> #false() , #eq(nil(), nil()) -> #true() , #eq(nil(), tuple#2(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), nil()) -> #false() , #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #greater(@x, @y) -> #ckgt(#compare(@x, @y)) , #compare(#0(), #0()) -> #EQ() , #compare(#0(), #neg(@y)) -> #GT() , #compare(#0(), #pos(@y)) -> #LT() , #compare(#0(), #s(@y)) -> #LT() , #compare(#neg(@x), #0()) -> #LT() , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x) , #compare(#neg(@x), #pos(@y)) -> #LT() , #compare(#pos(@x), #0()) -> #GT() , #compare(#pos(@x), #neg(@y)) -> #GT() , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y) , #compare(#s(@x), #0()) -> #GT() , #compare(#s(@x), #s(@y)) -> #compare(@x, @y) , #ckgt(#EQ()) -> #false() , #ckgt(#GT()) -> #true() , #ckgt(#LT()) -> #false() , #less(@x, @y) -> #cklt(#compare(@x, @y)) , #cklt(#EQ()) -> #false() , #cklt(#GT()) -> #false() , #cklt(#LT()) -> #true() , *(@x, @y) -> #mult(@x, @y) , #mult(#0(), #0()) -> #0() , #mult(#0(), #neg(@y)) -> #0() , #mult(#0(), #pos(@y)) -> #0() , #mult(#neg(@x), #0()) -> #0() , #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y)) , #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #0()) -> #0() , #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y)) , +(@x, @y) -> #add(@x, @y) , #add(#0(), @y) -> @y , #add(#neg(#s(#0())), @y) -> #pred(@y) , #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y)) , #add(#pos(#s(#0())), @y) -> #succ(@y) , #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y)) , -(@x, @y) -> #sub(@x, @y) , #sub(@x, #0()) -> @x , #sub(@x, #neg(@y)) -> #add(@x, #pos(@y)) , #sub(@x, #pos(@y)) -> #add(@x, #neg(@y)) , add(@b1, @b2) -> add'(@b1, @b2, #abs(#0())) , add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r) , add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs) , add'#1(nil(), @b2, @r) -> nil() , add'#2(::(@y, @ys), @r, @x, @xs) -> add'#3(sum(@x, @y, @r), @xs, @ys) , add'#2(nil(), @r, @x, @xs) -> nil() , sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r)) , add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r')) , bitToInt(@b) -> bitToInt'(@b, #abs(#pos(#s(#0())))) , bitToInt'(@b, @n) -> bitToInt'#1(@b, @n) , bitToInt'#1(::(@x, @xs), @n) -> +(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))) , bitToInt'#1(nil(), @n) -> #abs(#0()) , compare(@b1, @b2) -> compare#1(@b1, @b2) , compare#1(::(@x, @xs), @b2) -> compare#2(@b2, @x, @xs) , compare#1(nil(), @b2) -> #abs(#0()) , compare#2(::(@y, @ys), @x, @xs) -> compare#3(compare(@xs, @ys), @x, @y) , compare#2(nil(), @x, @xs) -> #abs(#0()) , compare#3(@r, @x, @y) -> compare#4(#equal(@r, #0()), @r, @x, @y) , compare#4(#false(), @r, @x, @y) -> @r , compare#4(#true(), @r, @x, @y) -> compare#5(#less(@x, @y), @x, @y) , compare#5(#false(), @x, @y) -> compare#6(#greater(@x, @y)) , compare#5(#true(), @x, @y) -> -(#0(), #pos(#s(#0()))) , compare#6(#false()) -> #abs(#0()) , compare#6(#true()) -> #abs(#pos(#s(#0()))) , diff(@x, @y, @r) -> tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))), diff#1(#less(-(-(@x, @y), @r), #0()))) , mod(@x, @y) -> -(@x, *(@y, div(@x, @y))) , diff#1(#false()) -> #abs(#0()) , diff#1(#true()) -> #abs(#pos(#s(#0()))) , div(@x, @y) -> #div(@x, @y) , #div(#0(), #0()) -> #divByZero() , #div(#0(), #neg(@y)) -> #0() , #div(#0(), #pos(@y)) -> #0() , #div(#neg(@x), #0()) -> #divByZero() , #div(#neg(@x), #neg(@y)) -> #positive(#natdiv(@x, @y)) , #div(#neg(@x), #pos(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #0()) -> #divByZero() , #div(#pos(@x), #neg(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #pos(@y)) -> #positive(#natdiv(@x, @y)) , leq(@b1, @b2) -> #less(compare(@b1, @b2), #pos(#s(#0()))) , mult(@b1, @b2) -> mult#1(@b1, @b2) , mult#1(::(@x, @xs), @b2) -> mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x) , mult#1(nil(), @b2) -> nil() , mult#2(@zs, @b2, @x) -> mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs) , mult#3(#false(), @b2, @zs) -> @zs , mult#3(#true(), @b2, @zs) -> add(@b2, @zs) , mult3(@b1, @b2, @b3) -> mult(mult(@b1, @b2), @b2) , sub(@b1, @b2) -> sub#1(sub'(@b1, @b2, #abs(#0()))) , sub'(@b1, @b2, @r) -> sub'#1(@b1, @b2, @r) , sub#1(tuple#2(@b, @_@1)) -> @b , sub'#1(::(@x, @xs), @b2, @r) -> sub'#2(@b2, @r, @x, @xs) , sub'#1(nil(), @b2, @r) -> tuple#2(nil(), @r) , sub'#2(::(@y, @ys), @r, @x, @xs) -> sub'#3(diff(@x, @y, @r), @xs, @ys) , sub'#2(nil(), @r, @x, @xs) -> tuple#2(nil(), @r) , sub'#3(tuple#2(@z, @r'), @xs, @ys) -> sub'#4(sub'(@xs, @ys, @r'), @z) , sub'#4(tuple#2(@zs, @s), @z) -> tuple#2(sub'#5(#equal(@s, #pos(#s(#0()))), @z, @zs), @s) , sub'#5(#false(), @z, @zs) -> ::(@z, @zs) , sub'#5(#true(), @z, @zs) -> ::(#abs(#0()), @zs) , sum#1(@s) -> sum#2(#equal(@s, #0()), @s) , sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s) , sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0())) , sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0()))))) , sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0())) , sum#4(#false()) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0())))) , sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0())))) , #pred(#0()) -> #neg(#s(#0())) , #pred(#neg(#s(@x))) -> #neg(#s(#s(@x))) , #pred(#pos(#s(#0()))) -> #0() , #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x)) , #succ(#0()) -> #pos(#s(#0())) , #succ(#neg(#s(#0()))) -> #0() , #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x)) , #succ(#pos(#s(@x))) -> #pos(#s(#s(@x))) , #and(#false(), #false()) -> #false() , #and(#false(), #true()) -> #false() , #and(#true(), #false()) -> #false() , #and(#true(), #true()) -> #true() , #natdiv(#0(), #0()) -> #divByZero() , #natdiv(#0(), #s(@y)) -> #0() , #natdiv(#s(@x), #0()) -> #divByZero() , #natdiv(#s(@x), #s(@y)) -> #natdiv'(#divsub(@x, @y), #s(@y)) , #positive(#0()) -> #0() , #positive(#neg(@x)) -> #neg(@x) , #positive(#pos(@x)) -> #pos(@x) , #positive(#s(@x)) -> #pos(#s(@x)) , #negative(#0()) -> #0() , #negative(#neg(@x)) -> #pos(@x) , #negative(#pos(@x)) -> #neg(@x) , #negative(#s(@x)) -> #neg(#s(@x)) , #divsub(#0(), #0()) -> #0() , #divsub(#0(), #s(@y)) -> #underflow() , #divsub(#s(@x), #0()) -> #s(@x) , #divsub(#s(@x), #s(@y)) -> #divsub(@x, @y) , #natmult(#0(), @y) -> #0() , #natmult(#s(@x), @y) -> #natadd(@y, #natmult(@x, @y)) , #natadd(#0(), @y) -> @y , #natadd(#s(@x), @y) -> #s(#natadd(@x, @y)) , #natdiv'(#0(), @y) -> #s(#0()) , #natdiv'(#s(@x), @y) -> #s(#natdiv(#s(@x), @y)) , #natdiv'(#underflow(), @y) -> #0() , #natsub(@x, #0()) -> @x , #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) } StartTerms: basic terms Strategy: innermost Problem (S): ------------ Strict DPs: { bitToInt^#(@b) -> c_6(bitToInt'^#(@b, #abs(#pos(#s(#0()))))) , bitToInt'^#(@b, @n) -> c_7(bitToInt'#1^#(@b, @n)) , bitToInt'#1^#(::(@x, @xs), @n) -> c_8(bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0())))))) , compare^#(@b1, @b2) -> c_9(compare#1^#(@b1, @b2)) , compare#1^#(::(@x, @xs), @b2) -> c_10(compare#2^#(@b2, @x, @xs)) , compare#2^#(::(@y, @ys), @x, @xs) -> c_11(compare^#(@xs, @ys)) , leq^#(@b1, @b2) -> c_12(compare^#(@b1, @b2)) , sub^#(@b1, @b2) -> c_18(sub'^#(@b1, @b2, #abs(#0()))) , sub'^#(@b1, @b2, @r) -> c_19(sub'#1^#(@b1, @b2, @r)) , sub'#1^#(::(@x, @xs), @b2, @r) -> c_20(sub'#2^#(@b2, @r, @x, @xs)) , sub'#2^#(::(@y, @ys), @r, @x, @xs) -> c_21(sub'#3^#(diff(@x, @y, @r), @xs, @ys)) , sub'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_22(sub'^#(@xs, @ys, @r')) } Weak DPs: { add^#(@b1, @b2) -> c_1(add'^#(@b1, @b2, #abs(#0()))) , add'^#(@b1, @b2, @r) -> c_2(add'#1^#(@b1, @b2, @r)) , add'#1^#(::(@x, @xs), @b2, @r) -> c_3(add'#2^#(@b2, @r, @x, @xs)) , add'#2^#(::(@y, @ys), @r, @x, @xs) -> c_4(add'#3^#(sum(@x, @y, @r), @xs, @ys)) , add'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_5(add'^#(@xs, @ys, @r')) , mult^#(@b1, @b2) -> c_13(mult#1^#(@b1, @b2)) , mult#1^#(::(@x, @xs), @b2) -> c_14(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x), mult^#(@xs, @b2)) , mult#2^#(@zs, @b2, @x) -> c_15(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs)) , mult#3^#(#true(), @b2, @zs) -> c_16(add^#(@b2, @zs)) , mult3^#(@b1, @b2, @b3) -> c_17(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2)) } Weak Trs: { #abs(#0()) -> #0() , #abs(#neg(@x)) -> #pos(@x) , #abs(#pos(@x)) -> #pos(@x) , #abs(#s(@x)) -> #pos(#s(@x)) , #equal(@x, @y) -> #eq(@x, @y) , #eq(#0(), #0()) -> #true() , #eq(#0(), #neg(@y)) -> #false() , #eq(#0(), #pos(@y)) -> #false() , #eq(#0(), #s(@y)) -> #false() , #eq(#neg(@x), #0()) -> #false() , #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #pos(@y)) -> #false() , #eq(#pos(@x), #0()) -> #false() , #eq(#pos(@x), #neg(@y)) -> #false() , #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y) , #eq(#s(@x), #0()) -> #false() , #eq(#s(@x), #s(@y)) -> #eq(@x, @y) , #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #eq(::(@x_1, @x_2), nil()) -> #false() , #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false() , #eq(nil(), ::(@y_1, @y_2)) -> #false() , #eq(nil(), nil()) -> #true() , #eq(nil(), tuple#2(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), nil()) -> #false() , #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #greater(@x, @y) -> #ckgt(#compare(@x, @y)) , #compare(#0(), #0()) -> #EQ() , #compare(#0(), #neg(@y)) -> #GT() , #compare(#0(), #pos(@y)) -> #LT() , #compare(#0(), #s(@y)) -> #LT() , #compare(#neg(@x), #0()) -> #LT() , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x) , #compare(#neg(@x), #pos(@y)) -> #LT() , #compare(#pos(@x), #0()) -> #GT() , #compare(#pos(@x), #neg(@y)) -> #GT() , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y) , #compare(#s(@x), #0()) -> #GT() , #compare(#s(@x), #s(@y)) -> #compare(@x, @y) , #ckgt(#EQ()) -> #false() , #ckgt(#GT()) -> #true() , #ckgt(#LT()) -> #false() , #less(@x, @y) -> #cklt(#compare(@x, @y)) , #cklt(#EQ()) -> #false() , #cklt(#GT()) -> #false() , #cklt(#LT()) -> #true() , *(@x, @y) -> #mult(@x, @y) , #mult(#0(), #0()) -> #0() , #mult(#0(), #neg(@y)) -> #0() , #mult(#0(), #pos(@y)) -> #0() , #mult(#neg(@x), #0()) -> #0() , #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y)) , #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #0()) -> #0() , #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y)) , +(@x, @y) -> #add(@x, @y) , #add(#0(), @y) -> @y , #add(#neg(#s(#0())), @y) -> #pred(@y) , #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y)) , #add(#pos(#s(#0())), @y) -> #succ(@y) , #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y)) , -(@x, @y) -> #sub(@x, @y) , #sub(@x, #0()) -> @x , #sub(@x, #neg(@y)) -> #add(@x, #pos(@y)) , #sub(@x, #pos(@y)) -> #add(@x, #neg(@y)) , add(@b1, @b2) -> add'(@b1, @b2, #abs(#0())) , add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r) , add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs) , add'#1(nil(), @b2, @r) -> nil() , add'#2(::(@y, @ys), @r, @x, @xs) -> add'#3(sum(@x, @y, @r), @xs, @ys) , add'#2(nil(), @r, @x, @xs) -> nil() , sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r)) , add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r')) , bitToInt(@b) -> bitToInt'(@b, #abs(#pos(#s(#0())))) , bitToInt'(@b, @n) -> bitToInt'#1(@b, @n) , bitToInt'#1(::(@x, @xs), @n) -> +(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))) , bitToInt'#1(nil(), @n) -> #abs(#0()) , compare(@b1, @b2) -> compare#1(@b1, @b2) , compare#1(::(@x, @xs), @b2) -> compare#2(@b2, @x, @xs) , compare#1(nil(), @b2) -> #abs(#0()) , compare#2(::(@y, @ys), @x, @xs) -> compare#3(compare(@xs, @ys), @x, @y) , compare#2(nil(), @x, @xs) -> #abs(#0()) , compare#3(@r, @x, @y) -> compare#4(#equal(@r, #0()), @r, @x, @y) , compare#4(#false(), @r, @x, @y) -> @r , compare#4(#true(), @r, @x, @y) -> compare#5(#less(@x, @y), @x, @y) , compare#5(#false(), @x, @y) -> compare#6(#greater(@x, @y)) , compare#5(#true(), @x, @y) -> -(#0(), #pos(#s(#0()))) , compare#6(#false()) -> #abs(#0()) , compare#6(#true()) -> #abs(#pos(#s(#0()))) , diff(@x, @y, @r) -> tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))), diff#1(#less(-(-(@x, @y), @r), #0()))) , mod(@x, @y) -> -(@x, *(@y, div(@x, @y))) , diff#1(#false()) -> #abs(#0()) , diff#1(#true()) -> #abs(#pos(#s(#0()))) , div(@x, @y) -> #div(@x, @y) , #div(#0(), #0()) -> #divByZero() , #div(#0(), #neg(@y)) -> #0() , #div(#0(), #pos(@y)) -> #0() , #div(#neg(@x), #0()) -> #divByZero() , #div(#neg(@x), #neg(@y)) -> #positive(#natdiv(@x, @y)) , #div(#neg(@x), #pos(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #0()) -> #divByZero() , #div(#pos(@x), #neg(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #pos(@y)) -> #positive(#natdiv(@x, @y)) , leq(@b1, @b2) -> #less(compare(@b1, @b2), #pos(#s(#0()))) , mult(@b1, @b2) -> mult#1(@b1, @b2) , mult#1(::(@x, @xs), @b2) -> mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x) , mult#1(nil(), @b2) -> nil() , mult#2(@zs, @b2, @x) -> mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs) , mult#3(#false(), @b2, @zs) -> @zs , mult#3(#true(), @b2, @zs) -> add(@b2, @zs) , mult3(@b1, @b2, @b3) -> mult(mult(@b1, @b2), @b2) , sub(@b1, @b2) -> sub#1(sub'(@b1, @b2, #abs(#0()))) , sub'(@b1, @b2, @r) -> sub'#1(@b1, @b2, @r) , sub#1(tuple#2(@b, @_@1)) -> @b , sub'#1(::(@x, @xs), @b2, @r) -> sub'#2(@b2, @r, @x, @xs) , sub'#1(nil(), @b2, @r) -> tuple#2(nil(), @r) , sub'#2(::(@y, @ys), @r, @x, @xs) -> sub'#3(diff(@x, @y, @r), @xs, @ys) , sub'#2(nil(), @r, @x, @xs) -> tuple#2(nil(), @r) , sub'#3(tuple#2(@z, @r'), @xs, @ys) -> sub'#4(sub'(@xs, @ys, @r'), @z) , sub'#4(tuple#2(@zs, @s), @z) -> tuple#2(sub'#5(#equal(@s, #pos(#s(#0()))), @z, @zs), @s) , sub'#5(#false(), @z, @zs) -> ::(@z, @zs) , sub'#5(#true(), @z, @zs) -> ::(#abs(#0()), @zs) , sum#1(@s) -> sum#2(#equal(@s, #0()), @s) , sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s) , sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0())) , sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0()))))) , sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0())) , sum#4(#false()) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0())))) , sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0())))) , #pred(#0()) -> #neg(#s(#0())) , #pred(#neg(#s(@x))) -> #neg(#s(#s(@x))) , #pred(#pos(#s(#0()))) -> #0() , #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x)) , #succ(#0()) -> #pos(#s(#0())) , #succ(#neg(#s(#0()))) -> #0() , #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x)) , #succ(#pos(#s(@x))) -> #pos(#s(#s(@x))) , #and(#false(), #false()) -> #false() , #and(#false(), #true()) -> #false() , #and(#true(), #false()) -> #false() , #and(#true(), #true()) -> #true() , #natdiv(#0(), #0()) -> #divByZero() , #natdiv(#0(), #s(@y)) -> #0() , #natdiv(#s(@x), #0()) -> #divByZero() , #natdiv(#s(@x), #s(@y)) -> #natdiv'(#divsub(@x, @y), #s(@y)) , #positive(#0()) -> #0() , #positive(#neg(@x)) -> #neg(@x) , #positive(#pos(@x)) -> #pos(@x) , #positive(#s(@x)) -> #pos(#s(@x)) , #negative(#0()) -> #0() , #negative(#neg(@x)) -> #pos(@x) , #negative(#pos(@x)) -> #neg(@x) , #negative(#s(@x)) -> #neg(#s(@x)) , #divsub(#0(), #0()) -> #0() , #divsub(#0(), #s(@y)) -> #underflow() , #divsub(#s(@x), #0()) -> #s(@x) , #divsub(#s(@x), #s(@y)) -> #divsub(@x, @y) , #natmult(#0(), @y) -> #0() , #natmult(#s(@x), @y) -> #natadd(@y, #natmult(@x, @y)) , #natadd(#0(), @y) -> @y , #natadd(#s(@x), @y) -> #s(#natadd(@x, @y)) , #natdiv'(#0(), @y) -> #s(#0()) , #natdiv'(#s(@x), @y) -> #s(#natdiv(#s(@x), @y)) , #natdiv'(#underflow(), @y) -> #0() , #natsub(@x, #0()) -> @x , #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) } StartTerms: basic terms Strategy: innermost Overall, the transformation results in the following sub-problem(s): Generated new problems: ----------------------- R) Strict DPs: { add^#(@b1, @b2) -> c_1(add'^#(@b1, @b2, #abs(#0()))) , add'^#(@b1, @b2, @r) -> c_2(add'#1^#(@b1, @b2, @r)) , add'#1^#(::(@x, @xs), @b2, @r) -> c_3(add'#2^#(@b2, @r, @x, @xs)) , add'#2^#(::(@y, @ys), @r, @x, @xs) -> c_4(add'#3^#(sum(@x, @y, @r), @xs, @ys)) , add'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_5(add'^#(@xs, @ys, @r')) , mult^#(@b1, @b2) -> c_13(mult#1^#(@b1, @b2)) , mult#1^#(::(@x, @xs), @b2) -> c_14(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x), mult^#(@xs, @b2)) , mult#2^#(@zs, @b2, @x) -> c_15(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs)) , mult#3^#(#true(), @b2, @zs) -> c_16(add^#(@b2, @zs)) , mult3^#(@b1, @b2, @b3) -> c_17(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2)) } Weak DPs: { bitToInt^#(@b) -> c_6(bitToInt'^#(@b, #abs(#pos(#s(#0()))))) , bitToInt'^#(@b, @n) -> c_7(bitToInt'#1^#(@b, @n)) , bitToInt'#1^#(::(@x, @xs), @n) -> c_8(bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0())))))) , compare^#(@b1, @b2) -> c_9(compare#1^#(@b1, @b2)) , compare#1^#(::(@x, @xs), @b2) -> c_10(compare#2^#(@b2, @x, @xs)) , compare#2^#(::(@y, @ys), @x, @xs) -> c_11(compare^#(@xs, @ys)) , leq^#(@b1, @b2) -> c_12(compare^#(@b1, @b2)) , sub^#(@b1, @b2) -> c_18(sub'^#(@b1, @b2, #abs(#0()))) , sub'^#(@b1, @b2, @r) -> c_19(sub'#1^#(@b1, @b2, @r)) , sub'#1^#(::(@x, @xs), @b2, @r) -> c_20(sub'#2^#(@b2, @r, @x, @xs)) , sub'#2^#(::(@y, @ys), @r, @x, @xs) -> c_21(sub'#3^#(diff(@x, @y, @r), @xs, @ys)) , sub'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_22(sub'^#(@xs, @ys, @r')) } Weak Trs: { #abs(#0()) -> #0() , #abs(#neg(@x)) -> #pos(@x) , #abs(#pos(@x)) -> #pos(@x) , #abs(#s(@x)) -> #pos(#s(@x)) , #equal(@x, @y) -> #eq(@x, @y) , #eq(#0(), #0()) -> #true() , #eq(#0(), #neg(@y)) -> #false() , #eq(#0(), #pos(@y)) -> #false() , #eq(#0(), #s(@y)) -> #false() , #eq(#neg(@x), #0()) -> #false() , #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #pos(@y)) -> #false() , #eq(#pos(@x), #0()) -> #false() , #eq(#pos(@x), #neg(@y)) -> #false() , #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y) , #eq(#s(@x), #0()) -> #false() , #eq(#s(@x), #s(@y)) -> #eq(@x, @y) , #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #eq(::(@x_1, @x_2), nil()) -> #false() , #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false() , #eq(nil(), ::(@y_1, @y_2)) -> #false() , #eq(nil(), nil()) -> #true() , #eq(nil(), tuple#2(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), nil()) -> #false() , #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #greater(@x, @y) -> #ckgt(#compare(@x, @y)) , #compare(#0(), #0()) -> #EQ() , #compare(#0(), #neg(@y)) -> #GT() , #compare(#0(), #pos(@y)) -> #LT() , #compare(#0(), #s(@y)) -> #LT() , #compare(#neg(@x), #0()) -> #LT() , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x) , #compare(#neg(@x), #pos(@y)) -> #LT() , #compare(#pos(@x), #0()) -> #GT() , #compare(#pos(@x), #neg(@y)) -> #GT() , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y) , #compare(#s(@x), #0()) -> #GT() , #compare(#s(@x), #s(@y)) -> #compare(@x, @y) , #ckgt(#EQ()) -> #false() , #ckgt(#GT()) -> #true() , #ckgt(#LT()) -> #false() , #less(@x, @y) -> #cklt(#compare(@x, @y)) , #cklt(#EQ()) -> #false() , #cklt(#GT()) -> #false() , #cklt(#LT()) -> #true() , *(@x, @y) -> #mult(@x, @y) , #mult(#0(), #0()) -> #0() , #mult(#0(), #neg(@y)) -> #0() , #mult(#0(), #pos(@y)) -> #0() , #mult(#neg(@x), #0()) -> #0() , #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y)) , #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #0()) -> #0() , #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y)) , +(@x, @y) -> #add(@x, @y) , #add(#0(), @y) -> @y , #add(#neg(#s(#0())), @y) -> #pred(@y) , #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y)) , #add(#pos(#s(#0())), @y) -> #succ(@y) , #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y)) , -(@x, @y) -> #sub(@x, @y) , #sub(@x, #0()) -> @x , #sub(@x, #neg(@y)) -> #add(@x, #pos(@y)) , #sub(@x, #pos(@y)) -> #add(@x, #neg(@y)) , add(@b1, @b2) -> add'(@b1, @b2, #abs(#0())) , add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r) , add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs) , add'#1(nil(), @b2, @r) -> nil() , add'#2(::(@y, @ys), @r, @x, @xs) -> add'#3(sum(@x, @y, @r), @xs, @ys) , add'#2(nil(), @r, @x, @xs) -> nil() , sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r)) , add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r')) , bitToInt(@b) -> bitToInt'(@b, #abs(#pos(#s(#0())))) , bitToInt'(@b, @n) -> bitToInt'#1(@b, @n) , bitToInt'#1(::(@x, @xs), @n) -> +(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))) , bitToInt'#1(nil(), @n) -> #abs(#0()) , compare(@b1, @b2) -> compare#1(@b1, @b2) , compare#1(::(@x, @xs), @b2) -> compare#2(@b2, @x, @xs) , compare#1(nil(), @b2) -> #abs(#0()) , compare#2(::(@y, @ys), @x, @xs) -> compare#3(compare(@xs, @ys), @x, @y) , compare#2(nil(), @x, @xs) -> #abs(#0()) , compare#3(@r, @x, @y) -> compare#4(#equal(@r, #0()), @r, @x, @y) , compare#4(#false(), @r, @x, @y) -> @r , compare#4(#true(), @r, @x, @y) -> compare#5(#less(@x, @y), @x, @y) , compare#5(#false(), @x, @y) -> compare#6(#greater(@x, @y)) , compare#5(#true(), @x, @y) -> -(#0(), #pos(#s(#0()))) , compare#6(#false()) -> #abs(#0()) , compare#6(#true()) -> #abs(#pos(#s(#0()))) , diff(@x, @y, @r) -> tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))), diff#1(#less(-(-(@x, @y), @r), #0()))) , mod(@x, @y) -> -(@x, *(@y, div(@x, @y))) , diff#1(#false()) -> #abs(#0()) , diff#1(#true()) -> #abs(#pos(#s(#0()))) , div(@x, @y) -> #div(@x, @y) , #div(#0(), #0()) -> #divByZero() , #div(#0(), #neg(@y)) -> #0() , #div(#0(), #pos(@y)) -> #0() , #div(#neg(@x), #0()) -> #divByZero() , #div(#neg(@x), #neg(@y)) -> #positive(#natdiv(@x, @y)) , #div(#neg(@x), #pos(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #0()) -> #divByZero() , #div(#pos(@x), #neg(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #pos(@y)) -> #positive(#natdiv(@x, @y)) , leq(@b1, @b2) -> #less(compare(@b1, @b2), #pos(#s(#0()))) , mult(@b1, @b2) -> mult#1(@b1, @b2) , mult#1(::(@x, @xs), @b2) -> mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x) , mult#1(nil(), @b2) -> nil() , mult#2(@zs, @b2, @x) -> mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs) , mult#3(#false(), @b2, @zs) -> @zs , mult#3(#true(), @b2, @zs) -> add(@b2, @zs) , mult3(@b1, @b2, @b3) -> mult(mult(@b1, @b2), @b2) , sub(@b1, @b2) -> sub#1(sub'(@b1, @b2, #abs(#0()))) , sub'(@b1, @b2, @r) -> sub'#1(@b1, @b2, @r) , sub#1(tuple#2(@b, @_@1)) -> @b , sub'#1(::(@x, @xs), @b2, @r) -> sub'#2(@b2, @r, @x, @xs) , sub'#1(nil(), @b2, @r) -> tuple#2(nil(), @r) , sub'#2(::(@y, @ys), @r, @x, @xs) -> sub'#3(diff(@x, @y, @r), @xs, @ys) , sub'#2(nil(), @r, @x, @xs) -> tuple#2(nil(), @r) , sub'#3(tuple#2(@z, @r'), @xs, @ys) -> sub'#4(sub'(@xs, @ys, @r'), @z) , sub'#4(tuple#2(@zs, @s), @z) -> tuple#2(sub'#5(#equal(@s, #pos(#s(#0()))), @z, @zs), @s) , sub'#5(#false(), @z, @zs) -> ::(@z, @zs) , sub'#5(#true(), @z, @zs) -> ::(#abs(#0()), @zs) , sum#1(@s) -> sum#2(#equal(@s, #0()), @s) , sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s) , sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0())) , sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0()))))) , sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0())) , sum#4(#false()) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0())))) , sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0())))) , #pred(#0()) -> #neg(#s(#0())) , #pred(#neg(#s(@x))) -> #neg(#s(#s(@x))) , #pred(#pos(#s(#0()))) -> #0() , #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x)) , #succ(#0()) -> #pos(#s(#0())) , #succ(#neg(#s(#0()))) -> #0() , #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x)) , #succ(#pos(#s(@x))) -> #pos(#s(#s(@x))) , #and(#false(), #false()) -> #false() , #and(#false(), #true()) -> #false() , #and(#true(), #false()) -> #false() , #and(#true(), #true()) -> #true() , #natdiv(#0(), #0()) -> #divByZero() , #natdiv(#0(), #s(@y)) -> #0() , #natdiv(#s(@x), #0()) -> #divByZero() , #natdiv(#s(@x), #s(@y)) -> #natdiv'(#divsub(@x, @y), #s(@y)) , #positive(#0()) -> #0() , #positive(#neg(@x)) -> #neg(@x) , #positive(#pos(@x)) -> #pos(@x) , #positive(#s(@x)) -> #pos(#s(@x)) , #negative(#0()) -> #0() , #negative(#neg(@x)) -> #pos(@x) , #negative(#pos(@x)) -> #neg(@x) , #negative(#s(@x)) -> #neg(#s(@x)) , #divsub(#0(), #0()) -> #0() , #divsub(#0(), #s(@y)) -> #underflow() , #divsub(#s(@x), #0()) -> #s(@x) , #divsub(#s(@x), #s(@y)) -> #divsub(@x, @y) , #natmult(#0(), @y) -> #0() , #natmult(#s(@x), @y) -> #natadd(@y, #natmult(@x, @y)) , #natadd(#0(), @y) -> @y , #natadd(#s(@x), @y) -> #s(#natadd(@x, @y)) , #natdiv'(#0(), @y) -> #s(#0()) , #natdiv'(#s(@x), @y) -> #s(#natdiv(#s(@x), @y)) , #natdiv'(#underflow(), @y) -> #0() , #natsub(@x, #0()) -> @x , #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) } StartTerms: basic terms Strategy: innermost This problem was proven YES(O(1),O(n^2)). S) Strict DPs: { bitToInt^#(@b) -> c_6(bitToInt'^#(@b, #abs(#pos(#s(#0()))))) , bitToInt'^#(@b, @n) -> c_7(bitToInt'#1^#(@b, @n)) , bitToInt'#1^#(::(@x, @xs), @n) -> c_8(bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0())))))) , compare^#(@b1, @b2) -> c_9(compare#1^#(@b1, @b2)) , compare#1^#(::(@x, @xs), @b2) -> c_10(compare#2^#(@b2, @x, @xs)) , compare#2^#(::(@y, @ys), @x, @xs) -> c_11(compare^#(@xs, @ys)) , leq^#(@b1, @b2) -> c_12(compare^#(@b1, @b2)) , sub^#(@b1, @b2) -> c_18(sub'^#(@b1, @b2, #abs(#0()))) , sub'^#(@b1, @b2, @r) -> c_19(sub'#1^#(@b1, @b2, @r)) , sub'#1^#(::(@x, @xs), @b2, @r) -> c_20(sub'#2^#(@b2, @r, @x, @xs)) , sub'#2^#(::(@y, @ys), @r, @x, @xs) -> c_21(sub'#3^#(diff(@x, @y, @r), @xs, @ys)) , sub'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_22(sub'^#(@xs, @ys, @r')) } Weak DPs: { add^#(@b1, @b2) -> c_1(add'^#(@b1, @b2, #abs(#0()))) , add'^#(@b1, @b2, @r) -> c_2(add'#1^#(@b1, @b2, @r)) , add'#1^#(::(@x, @xs), @b2, @r) -> c_3(add'#2^#(@b2, @r, @x, @xs)) , add'#2^#(::(@y, @ys), @r, @x, @xs) -> c_4(add'#3^#(sum(@x, @y, @r), @xs, @ys)) , add'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_5(add'^#(@xs, @ys, @r')) , mult^#(@b1, @b2) -> c_13(mult#1^#(@b1, @b2)) , mult#1^#(::(@x, @xs), @b2) -> c_14(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x), mult^#(@xs, @b2)) , mult#2^#(@zs, @b2, @x) -> c_15(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs)) , mult#3^#(#true(), @b2, @zs) -> c_16(add^#(@b2, @zs)) , mult3^#(@b1, @b2, @b3) -> c_17(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2)) } Weak Trs: { #abs(#0()) -> #0() , #abs(#neg(@x)) -> #pos(@x) , #abs(#pos(@x)) -> #pos(@x) , #abs(#s(@x)) -> #pos(#s(@x)) , #equal(@x, @y) -> #eq(@x, @y) , #eq(#0(), #0()) -> #true() , #eq(#0(), #neg(@y)) -> #false() , #eq(#0(), #pos(@y)) -> #false() , #eq(#0(), #s(@y)) -> #false() , #eq(#neg(@x), #0()) -> #false() , #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #pos(@y)) -> #false() , #eq(#pos(@x), #0()) -> #false() , #eq(#pos(@x), #neg(@y)) -> #false() , #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y) , #eq(#s(@x), #0()) -> #false() , #eq(#s(@x), #s(@y)) -> #eq(@x, @y) , #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #eq(::(@x_1, @x_2), nil()) -> #false() , #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false() , #eq(nil(), ::(@y_1, @y_2)) -> #false() , #eq(nil(), nil()) -> #true() , #eq(nil(), tuple#2(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), nil()) -> #false() , #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #greater(@x, @y) -> #ckgt(#compare(@x, @y)) , #compare(#0(), #0()) -> #EQ() , #compare(#0(), #neg(@y)) -> #GT() , #compare(#0(), #pos(@y)) -> #LT() , #compare(#0(), #s(@y)) -> #LT() , #compare(#neg(@x), #0()) -> #LT() , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x) , #compare(#neg(@x), #pos(@y)) -> #LT() , #compare(#pos(@x), #0()) -> #GT() , #compare(#pos(@x), #neg(@y)) -> #GT() , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y) , #compare(#s(@x), #0()) -> #GT() , #compare(#s(@x), #s(@y)) -> #compare(@x, @y) , #ckgt(#EQ()) -> #false() , #ckgt(#GT()) -> #true() , #ckgt(#LT()) -> #false() , #less(@x, @y) -> #cklt(#compare(@x, @y)) , #cklt(#EQ()) -> #false() , #cklt(#GT()) -> #false() , #cklt(#LT()) -> #true() , *(@x, @y) -> #mult(@x, @y) , #mult(#0(), #0()) -> #0() , #mult(#0(), #neg(@y)) -> #0() , #mult(#0(), #pos(@y)) -> #0() , #mult(#neg(@x), #0()) -> #0() , #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y)) , #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #0()) -> #0() , #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y)) , +(@x, @y) -> #add(@x, @y) , #add(#0(), @y) -> @y , #add(#neg(#s(#0())), @y) -> #pred(@y) , #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y)) , #add(#pos(#s(#0())), @y) -> #succ(@y) , #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y)) , -(@x, @y) -> #sub(@x, @y) , #sub(@x, #0()) -> @x , #sub(@x, #neg(@y)) -> #add(@x, #pos(@y)) , #sub(@x, #pos(@y)) -> #add(@x, #neg(@y)) , add(@b1, @b2) -> add'(@b1, @b2, #abs(#0())) , add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r) , add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs) , add'#1(nil(), @b2, @r) -> nil() , add'#2(::(@y, @ys), @r, @x, @xs) -> add'#3(sum(@x, @y, @r), @xs, @ys) , add'#2(nil(), @r, @x, @xs) -> nil() , sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r)) , add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r')) , bitToInt(@b) -> bitToInt'(@b, #abs(#pos(#s(#0())))) , bitToInt'(@b, @n) -> bitToInt'#1(@b, @n) , bitToInt'#1(::(@x, @xs), @n) -> +(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))) , bitToInt'#1(nil(), @n) -> #abs(#0()) , compare(@b1, @b2) -> compare#1(@b1, @b2) , compare#1(::(@x, @xs), @b2) -> compare#2(@b2, @x, @xs) , compare#1(nil(), @b2) -> #abs(#0()) , compare#2(::(@y, @ys), @x, @xs) -> compare#3(compare(@xs, @ys), @x, @y) , compare#2(nil(), @x, @xs) -> #abs(#0()) , compare#3(@r, @x, @y) -> compare#4(#equal(@r, #0()), @r, @x, @y) , compare#4(#false(), @r, @x, @y) -> @r , compare#4(#true(), @r, @x, @y) -> compare#5(#less(@x, @y), @x, @y) , compare#5(#false(), @x, @y) -> compare#6(#greater(@x, @y)) , compare#5(#true(), @x, @y) -> -(#0(), #pos(#s(#0()))) , compare#6(#false()) -> #abs(#0()) , compare#6(#true()) -> #abs(#pos(#s(#0()))) , diff(@x, @y, @r) -> tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))), diff#1(#less(-(-(@x, @y), @r), #0()))) , mod(@x, @y) -> -(@x, *(@y, div(@x, @y))) , diff#1(#false()) -> #abs(#0()) , diff#1(#true()) -> #abs(#pos(#s(#0()))) , div(@x, @y) -> #div(@x, @y) , #div(#0(), #0()) -> #divByZero() , #div(#0(), #neg(@y)) -> #0() , #div(#0(), #pos(@y)) -> #0() , #div(#neg(@x), #0()) -> #divByZero() , #div(#neg(@x), #neg(@y)) -> #positive(#natdiv(@x, @y)) , #div(#neg(@x), #pos(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #0()) -> #divByZero() , #div(#pos(@x), #neg(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #pos(@y)) -> #positive(#natdiv(@x, @y)) , leq(@b1, @b2) -> #less(compare(@b1, @b2), #pos(#s(#0()))) , mult(@b1, @b2) -> mult#1(@b1, @b2) , mult#1(::(@x, @xs), @b2) -> mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x) , mult#1(nil(), @b2) -> nil() , mult#2(@zs, @b2, @x) -> mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs) , mult#3(#false(), @b2, @zs) -> @zs , mult#3(#true(), @b2, @zs) -> add(@b2, @zs) , mult3(@b1, @b2, @b3) -> mult(mult(@b1, @b2), @b2) , sub(@b1, @b2) -> sub#1(sub'(@b1, @b2, #abs(#0()))) , sub'(@b1, @b2, @r) -> sub'#1(@b1, @b2, @r) , sub#1(tuple#2(@b, @_@1)) -> @b , sub'#1(::(@x, @xs), @b2, @r) -> sub'#2(@b2, @r, @x, @xs) , sub'#1(nil(), @b2, @r) -> tuple#2(nil(), @r) , sub'#2(::(@y, @ys), @r, @x, @xs) -> sub'#3(diff(@x, @y, @r), @xs, @ys) , sub'#2(nil(), @r, @x, @xs) -> tuple#2(nil(), @r) , sub'#3(tuple#2(@z, @r'), @xs, @ys) -> sub'#4(sub'(@xs, @ys, @r'), @z) , sub'#4(tuple#2(@zs, @s), @z) -> tuple#2(sub'#5(#equal(@s, #pos(#s(#0()))), @z, @zs), @s) , sub'#5(#false(), @z, @zs) -> ::(@z, @zs) , sub'#5(#true(), @z, @zs) -> ::(#abs(#0()), @zs) , sum#1(@s) -> sum#2(#equal(@s, #0()), @s) , sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s) , sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0())) , sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0()))))) , sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0())) , sum#4(#false()) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0())))) , sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0())))) , #pred(#0()) -> #neg(#s(#0())) , #pred(#neg(#s(@x))) -> #neg(#s(#s(@x))) , #pred(#pos(#s(#0()))) -> #0() , #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x)) , #succ(#0()) -> #pos(#s(#0())) , #succ(#neg(#s(#0()))) -> #0() , #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x)) , #succ(#pos(#s(@x))) -> #pos(#s(#s(@x))) , #and(#false(), #false()) -> #false() , #and(#false(), #true()) -> #false() , #and(#true(), #false()) -> #false() , #and(#true(), #true()) -> #true() , #natdiv(#0(), #0()) -> #divByZero() , #natdiv(#0(), #s(@y)) -> #0() , #natdiv(#s(@x), #0()) -> #divByZero() , #natdiv(#s(@x), #s(@y)) -> #natdiv'(#divsub(@x, @y), #s(@y)) , #positive(#0()) -> #0() , #positive(#neg(@x)) -> #neg(@x) , #positive(#pos(@x)) -> #pos(@x) , #positive(#s(@x)) -> #pos(#s(@x)) , #negative(#0()) -> #0() , #negative(#neg(@x)) -> #pos(@x) , #negative(#pos(@x)) -> #neg(@x) , #negative(#s(@x)) -> #neg(#s(@x)) , #divsub(#0(), #0()) -> #0() , #divsub(#0(), #s(@y)) -> #underflow() , #divsub(#s(@x), #0()) -> #s(@x) , #divsub(#s(@x), #s(@y)) -> #divsub(@x, @y) , #natmult(#0(), @y) -> #0() , #natmult(#s(@x), @y) -> #natadd(@y, #natmult(@x, @y)) , #natadd(#0(), @y) -> @y , #natadd(#s(@x), @y) -> #s(#natadd(@x, @y)) , #natdiv'(#0(), @y) -> #s(#0()) , #natdiv'(#s(@x), @y) -> #s(#natdiv(#s(@x), @y)) , #natdiv'(#underflow(), @y) -> #0() , #natsub(@x, #0()) -> @x , #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) } StartTerms: basic terms Strategy: innermost This problem was proven YES(O(1),O(n^1)). Proofs for generated problems: ------------------------------ R) We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^2)). Strict DPs: { add^#(@b1, @b2) -> c_1(add'^#(@b1, @b2, #abs(#0()))) , add'^#(@b1, @b2, @r) -> c_2(add'#1^#(@b1, @b2, @r)) , add'#1^#(::(@x, @xs), @b2, @r) -> c_3(add'#2^#(@b2, @r, @x, @xs)) , add'#2^#(::(@y, @ys), @r, @x, @xs) -> c_4(add'#3^#(sum(@x, @y, @r), @xs, @ys)) , add'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_5(add'^#(@xs, @ys, @r')) , mult^#(@b1, @b2) -> c_13(mult#1^#(@b1, @b2)) , mult#1^#(::(@x, @xs), @b2) -> c_14(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x), mult^#(@xs, @b2)) , mult#2^#(@zs, @b2, @x) -> c_15(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs)) , mult#3^#(#true(), @b2, @zs) -> c_16(add^#(@b2, @zs)) , mult3^#(@b1, @b2, @b3) -> c_17(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2)) } Weak DPs: { bitToInt^#(@b) -> c_6(bitToInt'^#(@b, #abs(#pos(#s(#0()))))) , bitToInt'^#(@b, @n) -> c_7(bitToInt'#1^#(@b, @n)) , bitToInt'#1^#(::(@x, @xs), @n) -> c_8(bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0())))))) , compare^#(@b1, @b2) -> c_9(compare#1^#(@b1, @b2)) , compare#1^#(::(@x, @xs), @b2) -> c_10(compare#2^#(@b2, @x, @xs)) , compare#2^#(::(@y, @ys), @x, @xs) -> c_11(compare^#(@xs, @ys)) , leq^#(@b1, @b2) -> c_12(compare^#(@b1, @b2)) , sub^#(@b1, @b2) -> c_18(sub'^#(@b1, @b2, #abs(#0()))) , sub'^#(@b1, @b2, @r) -> c_19(sub'#1^#(@b1, @b2, @r)) , sub'#1^#(::(@x, @xs), @b2, @r) -> c_20(sub'#2^#(@b2, @r, @x, @xs)) , sub'#2^#(::(@y, @ys), @r, @x, @xs) -> c_21(sub'#3^#(diff(@x, @y, @r), @xs, @ys)) , sub'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_22(sub'^#(@xs, @ys, @r')) } Weak Trs: { #abs(#0()) -> #0() , #abs(#neg(@x)) -> #pos(@x) , #abs(#pos(@x)) -> #pos(@x) , #abs(#s(@x)) -> #pos(#s(@x)) , #equal(@x, @y) -> #eq(@x, @y) , #eq(#0(), #0()) -> #true() , #eq(#0(), #neg(@y)) -> #false() , #eq(#0(), #pos(@y)) -> #false() , #eq(#0(), #s(@y)) -> #false() , #eq(#neg(@x), #0()) -> #false() , #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #pos(@y)) -> #false() , #eq(#pos(@x), #0()) -> #false() , #eq(#pos(@x), #neg(@y)) -> #false() , #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y) , #eq(#s(@x), #0()) -> #false() , #eq(#s(@x), #s(@y)) -> #eq(@x, @y) , #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #eq(::(@x_1, @x_2), nil()) -> #false() , #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false() , #eq(nil(), ::(@y_1, @y_2)) -> #false() , #eq(nil(), nil()) -> #true() , #eq(nil(), tuple#2(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), nil()) -> #false() , #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #greater(@x, @y) -> #ckgt(#compare(@x, @y)) , #compare(#0(), #0()) -> #EQ() , #compare(#0(), #neg(@y)) -> #GT() , #compare(#0(), #pos(@y)) -> #LT() , #compare(#0(), #s(@y)) -> #LT() , #compare(#neg(@x), #0()) -> #LT() , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x) , #compare(#neg(@x), #pos(@y)) -> #LT() , #compare(#pos(@x), #0()) -> #GT() , #compare(#pos(@x), #neg(@y)) -> #GT() , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y) , #compare(#s(@x), #0()) -> #GT() , #compare(#s(@x), #s(@y)) -> #compare(@x, @y) , #ckgt(#EQ()) -> #false() , #ckgt(#GT()) -> #true() , #ckgt(#LT()) -> #false() , #less(@x, @y) -> #cklt(#compare(@x, @y)) , #cklt(#EQ()) -> #false() , #cklt(#GT()) -> #false() , #cklt(#LT()) -> #true() , *(@x, @y) -> #mult(@x, @y) , #mult(#0(), #0()) -> #0() , #mult(#0(), #neg(@y)) -> #0() , #mult(#0(), #pos(@y)) -> #0() , #mult(#neg(@x), #0()) -> #0() , #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y)) , #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #0()) -> #0() , #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y)) , +(@x, @y) -> #add(@x, @y) , #add(#0(), @y) -> @y , #add(#neg(#s(#0())), @y) -> #pred(@y) , #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y)) , #add(#pos(#s(#0())), @y) -> #succ(@y) , #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y)) , -(@x, @y) -> #sub(@x, @y) , #sub(@x, #0()) -> @x , #sub(@x, #neg(@y)) -> #add(@x, #pos(@y)) , #sub(@x, #pos(@y)) -> #add(@x, #neg(@y)) , add(@b1, @b2) -> add'(@b1, @b2, #abs(#0())) , add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r) , add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs) , add'#1(nil(), @b2, @r) -> nil() , add'#2(::(@y, @ys), @r, @x, @xs) -> add'#3(sum(@x, @y, @r), @xs, @ys) , add'#2(nil(), @r, @x, @xs) -> nil() , sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r)) , add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r')) , bitToInt(@b) -> bitToInt'(@b, #abs(#pos(#s(#0())))) , bitToInt'(@b, @n) -> bitToInt'#1(@b, @n) , bitToInt'#1(::(@x, @xs), @n) -> +(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))) , bitToInt'#1(nil(), @n) -> #abs(#0()) , compare(@b1, @b2) -> compare#1(@b1, @b2) , compare#1(::(@x, @xs), @b2) -> compare#2(@b2, @x, @xs) , compare#1(nil(), @b2) -> #abs(#0()) , compare#2(::(@y, @ys), @x, @xs) -> compare#3(compare(@xs, @ys), @x, @y) , compare#2(nil(), @x, @xs) -> #abs(#0()) , compare#3(@r, @x, @y) -> compare#4(#equal(@r, #0()), @r, @x, @y) , compare#4(#false(), @r, @x, @y) -> @r , compare#4(#true(), @r, @x, @y) -> compare#5(#less(@x, @y), @x, @y) , compare#5(#false(), @x, @y) -> compare#6(#greater(@x, @y)) , compare#5(#true(), @x, @y) -> -(#0(), #pos(#s(#0()))) , compare#6(#false()) -> #abs(#0()) , compare#6(#true()) -> #abs(#pos(#s(#0()))) , diff(@x, @y, @r) -> tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))), diff#1(#less(-(-(@x, @y), @r), #0()))) , mod(@x, @y) -> -(@x, *(@y, div(@x, @y))) , diff#1(#false()) -> #abs(#0()) , diff#1(#true()) -> #abs(#pos(#s(#0()))) , div(@x, @y) -> #div(@x, @y) , #div(#0(), #0()) -> #divByZero() , #div(#0(), #neg(@y)) -> #0() , #div(#0(), #pos(@y)) -> #0() , #div(#neg(@x), #0()) -> #divByZero() , #div(#neg(@x), #neg(@y)) -> #positive(#natdiv(@x, @y)) , #div(#neg(@x), #pos(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #0()) -> #divByZero() , #div(#pos(@x), #neg(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #pos(@y)) -> #positive(#natdiv(@x, @y)) , leq(@b1, @b2) -> #less(compare(@b1, @b2), #pos(#s(#0()))) , mult(@b1, @b2) -> mult#1(@b1, @b2) , mult#1(::(@x, @xs), @b2) -> mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x) , mult#1(nil(), @b2) -> nil() , mult#2(@zs, @b2, @x) -> mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs) , mult#3(#false(), @b2, @zs) -> @zs , mult#3(#true(), @b2, @zs) -> add(@b2, @zs) , mult3(@b1, @b2, @b3) -> mult(mult(@b1, @b2), @b2) , sub(@b1, @b2) -> sub#1(sub'(@b1, @b2, #abs(#0()))) , sub'(@b1, @b2, @r) -> sub'#1(@b1, @b2, @r) , sub#1(tuple#2(@b, @_@1)) -> @b , sub'#1(::(@x, @xs), @b2, @r) -> sub'#2(@b2, @r, @x, @xs) , sub'#1(nil(), @b2, @r) -> tuple#2(nil(), @r) , sub'#2(::(@y, @ys), @r, @x, @xs) -> sub'#3(diff(@x, @y, @r), @xs, @ys) , sub'#2(nil(), @r, @x, @xs) -> tuple#2(nil(), @r) , sub'#3(tuple#2(@z, @r'), @xs, @ys) -> sub'#4(sub'(@xs, @ys, @r'), @z) , sub'#4(tuple#2(@zs, @s), @z) -> tuple#2(sub'#5(#equal(@s, #pos(#s(#0()))), @z, @zs), @s) , sub'#5(#false(), @z, @zs) -> ::(@z, @zs) , sub'#5(#true(), @z, @zs) -> ::(#abs(#0()), @zs) , sum#1(@s) -> sum#2(#equal(@s, #0()), @s) , sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s) , sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0())) , sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0()))))) , sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0())) , sum#4(#false()) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0())))) , sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0())))) , #pred(#0()) -> #neg(#s(#0())) , #pred(#neg(#s(@x))) -> #neg(#s(#s(@x))) , #pred(#pos(#s(#0()))) -> #0() , #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x)) , #succ(#0()) -> #pos(#s(#0())) , #succ(#neg(#s(#0()))) -> #0() , #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x)) , #succ(#pos(#s(@x))) -> #pos(#s(#s(@x))) , #and(#false(), #false()) -> #false() , #and(#false(), #true()) -> #false() , #and(#true(), #false()) -> #false() , #and(#true(), #true()) -> #true() , #natdiv(#0(), #0()) -> #divByZero() , #natdiv(#0(), #s(@y)) -> #0() , #natdiv(#s(@x), #0()) -> #divByZero() , #natdiv(#s(@x), #s(@y)) -> #natdiv'(#divsub(@x, @y), #s(@y)) , #positive(#0()) -> #0() , #positive(#neg(@x)) -> #neg(@x) , #positive(#pos(@x)) -> #pos(@x) , #positive(#s(@x)) -> #pos(#s(@x)) , #negative(#0()) -> #0() , #negative(#neg(@x)) -> #pos(@x) , #negative(#pos(@x)) -> #neg(@x) , #negative(#s(@x)) -> #neg(#s(@x)) , #divsub(#0(), #0()) -> #0() , #divsub(#0(), #s(@y)) -> #underflow() , #divsub(#s(@x), #0()) -> #s(@x) , #divsub(#s(@x), #s(@y)) -> #divsub(@x, @y) , #natmult(#0(), @y) -> #0() , #natmult(#s(@x), @y) -> #natadd(@y, #natmult(@x, @y)) , #natadd(#0(), @y) -> @y , #natadd(#s(@x), @y) -> #s(#natadd(@x, @y)) , #natdiv'(#0(), @y) -> #s(#0()) , #natdiv'(#s(@x), @y) -> #s(#natdiv(#s(@x), @y)) , #natdiv'(#underflow(), @y) -> #0() , #natsub(@x, #0()) -> @x , #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^2)) The following weak DPs constitute a sub-graph of the DG that is closed under successors. The DPs are removed. { bitToInt^#(@b) -> c_6(bitToInt'^#(@b, #abs(#pos(#s(#0()))))) , bitToInt'^#(@b, @n) -> c_7(bitToInt'#1^#(@b, @n)) , bitToInt'#1^#(::(@x, @xs), @n) -> c_8(bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0())))))) , compare^#(@b1, @b2) -> c_9(compare#1^#(@b1, @b2)) , compare#1^#(::(@x, @xs), @b2) -> c_10(compare#2^#(@b2, @x, @xs)) , compare#2^#(::(@y, @ys), @x, @xs) -> c_11(compare^#(@xs, @ys)) , leq^#(@b1, @b2) -> c_12(compare^#(@b1, @b2)) , sub^#(@b1, @b2) -> c_18(sub'^#(@b1, @b2, #abs(#0()))) , sub'^#(@b1, @b2, @r) -> c_19(sub'#1^#(@b1, @b2, @r)) , sub'#1^#(::(@x, @xs), @b2, @r) -> c_20(sub'#2^#(@b2, @r, @x, @xs)) , sub'#2^#(::(@y, @ys), @r, @x, @xs) -> c_21(sub'#3^#(diff(@x, @y, @r), @xs, @ys)) , sub'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_22(sub'^#(@xs, @ys, @r')) } We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^2)). Strict DPs: { add^#(@b1, @b2) -> c_1(add'^#(@b1, @b2, #abs(#0()))) , add'^#(@b1, @b2, @r) -> c_2(add'#1^#(@b1, @b2, @r)) , add'#1^#(::(@x, @xs), @b2, @r) -> c_3(add'#2^#(@b2, @r, @x, @xs)) , add'#2^#(::(@y, @ys), @r, @x, @xs) -> c_4(add'#3^#(sum(@x, @y, @r), @xs, @ys)) , add'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_5(add'^#(@xs, @ys, @r')) , mult^#(@b1, @b2) -> c_13(mult#1^#(@b1, @b2)) , mult#1^#(::(@x, @xs), @b2) -> c_14(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x), mult^#(@xs, @b2)) , mult#2^#(@zs, @b2, @x) -> c_15(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs)) , mult#3^#(#true(), @b2, @zs) -> c_16(add^#(@b2, @zs)) , mult3^#(@b1, @b2, @b3) -> c_17(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2)) } Weak Trs: { #abs(#0()) -> #0() , #abs(#neg(@x)) -> #pos(@x) , #abs(#pos(@x)) -> #pos(@x) , #abs(#s(@x)) -> #pos(#s(@x)) , #equal(@x, @y) -> #eq(@x, @y) , #eq(#0(), #0()) -> #true() , #eq(#0(), #neg(@y)) -> #false() , #eq(#0(), #pos(@y)) -> #false() , #eq(#0(), #s(@y)) -> #false() , #eq(#neg(@x), #0()) -> #false() , #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #pos(@y)) -> #false() , #eq(#pos(@x), #0()) -> #false() , #eq(#pos(@x), #neg(@y)) -> #false() , #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y) , #eq(#s(@x), #0()) -> #false() , #eq(#s(@x), #s(@y)) -> #eq(@x, @y) , #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #eq(::(@x_1, @x_2), nil()) -> #false() , #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false() , #eq(nil(), ::(@y_1, @y_2)) -> #false() , #eq(nil(), nil()) -> #true() , #eq(nil(), tuple#2(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), nil()) -> #false() , #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #greater(@x, @y) -> #ckgt(#compare(@x, @y)) , #compare(#0(), #0()) -> #EQ() , #compare(#0(), #neg(@y)) -> #GT() , #compare(#0(), #pos(@y)) -> #LT() , #compare(#0(), #s(@y)) -> #LT() , #compare(#neg(@x), #0()) -> #LT() , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x) , #compare(#neg(@x), #pos(@y)) -> #LT() , #compare(#pos(@x), #0()) -> #GT() , #compare(#pos(@x), #neg(@y)) -> #GT() , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y) , #compare(#s(@x), #0()) -> #GT() , #compare(#s(@x), #s(@y)) -> #compare(@x, @y) , #ckgt(#EQ()) -> #false() , #ckgt(#GT()) -> #true() , #ckgt(#LT()) -> #false() , #less(@x, @y) -> #cklt(#compare(@x, @y)) , #cklt(#EQ()) -> #false() , #cklt(#GT()) -> #false() , #cklt(#LT()) -> #true() , *(@x, @y) -> #mult(@x, @y) , #mult(#0(), #0()) -> #0() , #mult(#0(), #neg(@y)) -> #0() , #mult(#0(), #pos(@y)) -> #0() , #mult(#neg(@x), #0()) -> #0() , #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y)) , #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #0()) -> #0() , #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y)) , +(@x, @y) -> #add(@x, @y) , #add(#0(), @y) -> @y , #add(#neg(#s(#0())), @y) -> #pred(@y) , #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y)) , #add(#pos(#s(#0())), @y) -> #succ(@y) , #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y)) , -(@x, @y) -> #sub(@x, @y) , #sub(@x, #0()) -> @x , #sub(@x, #neg(@y)) -> #add(@x, #pos(@y)) , #sub(@x, #pos(@y)) -> #add(@x, #neg(@y)) , add(@b1, @b2) -> add'(@b1, @b2, #abs(#0())) , add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r) , add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs) , add'#1(nil(), @b2, @r) -> nil() , add'#2(::(@y, @ys), @r, @x, @xs) -> add'#3(sum(@x, @y, @r), @xs, @ys) , add'#2(nil(), @r, @x, @xs) -> nil() , sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r)) , add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r')) , bitToInt(@b) -> bitToInt'(@b, #abs(#pos(#s(#0())))) , bitToInt'(@b, @n) -> bitToInt'#1(@b, @n) , bitToInt'#1(::(@x, @xs), @n) -> +(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))) , bitToInt'#1(nil(), @n) -> #abs(#0()) , compare(@b1, @b2) -> compare#1(@b1, @b2) , compare#1(::(@x, @xs), @b2) -> compare#2(@b2, @x, @xs) , compare#1(nil(), @b2) -> #abs(#0()) , compare#2(::(@y, @ys), @x, @xs) -> compare#3(compare(@xs, @ys), @x, @y) , compare#2(nil(), @x, @xs) -> #abs(#0()) , compare#3(@r, @x, @y) -> compare#4(#equal(@r, #0()), @r, @x, @y) , compare#4(#false(), @r, @x, @y) -> @r , compare#4(#true(), @r, @x, @y) -> compare#5(#less(@x, @y), @x, @y) , compare#5(#false(), @x, @y) -> compare#6(#greater(@x, @y)) , compare#5(#true(), @x, @y) -> -(#0(), #pos(#s(#0()))) , compare#6(#false()) -> #abs(#0()) , compare#6(#true()) -> #abs(#pos(#s(#0()))) , diff(@x, @y, @r) -> tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))), diff#1(#less(-(-(@x, @y), @r), #0()))) , mod(@x, @y) -> -(@x, *(@y, div(@x, @y))) , diff#1(#false()) -> #abs(#0()) , diff#1(#true()) -> #abs(#pos(#s(#0()))) , div(@x, @y) -> #div(@x, @y) , #div(#0(), #0()) -> #divByZero() , #div(#0(), #neg(@y)) -> #0() , #div(#0(), #pos(@y)) -> #0() , #div(#neg(@x), #0()) -> #divByZero() , #div(#neg(@x), #neg(@y)) -> #positive(#natdiv(@x, @y)) , #div(#neg(@x), #pos(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #0()) -> #divByZero() , #div(#pos(@x), #neg(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #pos(@y)) -> #positive(#natdiv(@x, @y)) , leq(@b1, @b2) -> #less(compare(@b1, @b2), #pos(#s(#0()))) , mult(@b1, @b2) -> mult#1(@b1, @b2) , mult#1(::(@x, @xs), @b2) -> mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x) , mult#1(nil(), @b2) -> nil() , mult#2(@zs, @b2, @x) -> mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs) , mult#3(#false(), @b2, @zs) -> @zs , mult#3(#true(), @b2, @zs) -> add(@b2, @zs) , mult3(@b1, @b2, @b3) -> mult(mult(@b1, @b2), @b2) , sub(@b1, @b2) -> sub#1(sub'(@b1, @b2, #abs(#0()))) , sub'(@b1, @b2, @r) -> sub'#1(@b1, @b2, @r) , sub#1(tuple#2(@b, @_@1)) -> @b , sub'#1(::(@x, @xs), @b2, @r) -> sub'#2(@b2, @r, @x, @xs) , sub'#1(nil(), @b2, @r) -> tuple#2(nil(), @r) , sub'#2(::(@y, @ys), @r, @x, @xs) -> sub'#3(diff(@x, @y, @r), @xs, @ys) , sub'#2(nil(), @r, @x, @xs) -> tuple#2(nil(), @r) , sub'#3(tuple#2(@z, @r'), @xs, @ys) -> sub'#4(sub'(@xs, @ys, @r'), @z) , sub'#4(tuple#2(@zs, @s), @z) -> tuple#2(sub'#5(#equal(@s, #pos(#s(#0()))), @z, @zs), @s) , sub'#5(#false(), @z, @zs) -> ::(@z, @zs) , sub'#5(#true(), @z, @zs) -> ::(#abs(#0()), @zs) , sum#1(@s) -> sum#2(#equal(@s, #0()), @s) , sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s) , sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0())) , sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0()))))) , sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0())) , sum#4(#false()) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0())))) , sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0())))) , #pred(#0()) -> #neg(#s(#0())) , #pred(#neg(#s(@x))) -> #neg(#s(#s(@x))) , #pred(#pos(#s(#0()))) -> #0() , #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x)) , #succ(#0()) -> #pos(#s(#0())) , #succ(#neg(#s(#0()))) -> #0() , #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x)) , #succ(#pos(#s(@x))) -> #pos(#s(#s(@x))) , #and(#false(), #false()) -> #false() , #and(#false(), #true()) -> #false() , #and(#true(), #false()) -> #false() , #and(#true(), #true()) -> #true() , #natdiv(#0(), #0()) -> #divByZero() , #natdiv(#0(), #s(@y)) -> #0() , #natdiv(#s(@x), #0()) -> #divByZero() , #natdiv(#s(@x), #s(@y)) -> #natdiv'(#divsub(@x, @y), #s(@y)) , #positive(#0()) -> #0() , #positive(#neg(@x)) -> #neg(@x) , #positive(#pos(@x)) -> #pos(@x) , #positive(#s(@x)) -> #pos(#s(@x)) , #negative(#0()) -> #0() , #negative(#neg(@x)) -> #pos(@x) , #negative(#pos(@x)) -> #neg(@x) , #negative(#s(@x)) -> #neg(#s(@x)) , #divsub(#0(), #0()) -> #0() , #divsub(#0(), #s(@y)) -> #underflow() , #divsub(#s(@x), #0()) -> #s(@x) , #divsub(#s(@x), #s(@y)) -> #divsub(@x, @y) , #natmult(#0(), @y) -> #0() , #natmult(#s(@x), @y) -> #natadd(@y, #natmult(@x, @y)) , #natadd(#0(), @y) -> @y , #natadd(#s(@x), @y) -> #s(#natadd(@x, @y)) , #natdiv'(#0(), @y) -> #s(#0()) , #natdiv'(#s(@x), @y) -> #s(#natdiv(#s(@x), @y)) , #natdiv'(#underflow(), @y) -> #0() , #natsub(@x, #0()) -> @x , #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^2)) We replace rewrite rules by usable rules: Weak Usable Rules: { #abs(#0()) -> #0() , #abs(#neg(@x)) -> #pos(@x) , #abs(#pos(@x)) -> #pos(@x) , #abs(#s(@x)) -> #pos(#s(@x)) , #equal(@x, @y) -> #eq(@x, @y) , #eq(#0(), #0()) -> #true() , #eq(#0(), #neg(@y)) -> #false() , #eq(#0(), #pos(@y)) -> #false() , #eq(#0(), #s(@y)) -> #false() , #eq(#neg(@x), #0()) -> #false() , #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #pos(@y)) -> #false() , #eq(#pos(@x), #0()) -> #false() , #eq(#pos(@x), #neg(@y)) -> #false() , #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y) , #eq(#s(@x), #0()) -> #false() , #eq(#s(@x), #s(@y)) -> #eq(@x, @y) , #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #eq(::(@x_1, @x_2), nil()) -> #false() , #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false() , #eq(nil(), ::(@y_1, @y_2)) -> #false() , #eq(nil(), nil()) -> #true() , #eq(nil(), tuple#2(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), nil()) -> #false() , #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , +(@x, @y) -> #add(@x, @y) , #add(#0(), @y) -> @y , #add(#neg(#s(#0())), @y) -> #pred(@y) , #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y)) , #add(#pos(#s(#0())), @y) -> #succ(@y) , #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y)) , add(@b1, @b2) -> add'(@b1, @b2, #abs(#0())) , add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r) , add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs) , add'#1(nil(), @b2, @r) -> nil() , add'#2(::(@y, @ys), @r, @x, @xs) -> add'#3(sum(@x, @y, @r), @xs, @ys) , add'#2(nil(), @r, @x, @xs) -> nil() , sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r)) , add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r')) , mult(@b1, @b2) -> mult#1(@b1, @b2) , mult#1(::(@x, @xs), @b2) -> mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x) , mult#1(nil(), @b2) -> nil() , mult#2(@zs, @b2, @x) -> mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs) , mult#3(#false(), @b2, @zs) -> @zs , mult#3(#true(), @b2, @zs) -> add(@b2, @zs) , sum#1(@s) -> sum#2(#equal(@s, #0()), @s) , sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s) , sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0())) , sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0()))))) , sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0())) , sum#4(#false()) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0())))) , sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0())))) , #pred(#0()) -> #neg(#s(#0())) , #pred(#neg(#s(@x))) -> #neg(#s(#s(@x))) , #pred(#pos(#s(#0()))) -> #0() , #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x)) , #succ(#0()) -> #pos(#s(#0())) , #succ(#neg(#s(#0()))) -> #0() , #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x)) , #succ(#pos(#s(@x))) -> #pos(#s(#s(@x))) , #and(#false(), #false()) -> #false() , #and(#false(), #true()) -> #false() , #and(#true(), #false()) -> #false() , #and(#true(), #true()) -> #true() } We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^2)). Strict DPs: { add^#(@b1, @b2) -> c_1(add'^#(@b1, @b2, #abs(#0()))) , add'^#(@b1, @b2, @r) -> c_2(add'#1^#(@b1, @b2, @r)) , add'#1^#(::(@x, @xs), @b2, @r) -> c_3(add'#2^#(@b2, @r, @x, @xs)) , add'#2^#(::(@y, @ys), @r, @x, @xs) -> c_4(add'#3^#(sum(@x, @y, @r), @xs, @ys)) , add'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_5(add'^#(@xs, @ys, @r')) , mult^#(@b1, @b2) -> c_13(mult#1^#(@b1, @b2)) , mult#1^#(::(@x, @xs), @b2) -> c_14(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x), mult^#(@xs, @b2)) , mult#2^#(@zs, @b2, @x) -> c_15(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs)) , mult#3^#(#true(), @b2, @zs) -> c_16(add^#(@b2, @zs)) , mult3^#(@b1, @b2, @b3) -> c_17(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2)) } Weak Trs: { #abs(#0()) -> #0() , #abs(#neg(@x)) -> #pos(@x) , #abs(#pos(@x)) -> #pos(@x) , #abs(#s(@x)) -> #pos(#s(@x)) , #equal(@x, @y) -> #eq(@x, @y) , #eq(#0(), #0()) -> #true() , #eq(#0(), #neg(@y)) -> #false() , #eq(#0(), #pos(@y)) -> #false() , #eq(#0(), #s(@y)) -> #false() , #eq(#neg(@x), #0()) -> #false() , #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #pos(@y)) -> #false() , #eq(#pos(@x), #0()) -> #false() , #eq(#pos(@x), #neg(@y)) -> #false() , #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y) , #eq(#s(@x), #0()) -> #false() , #eq(#s(@x), #s(@y)) -> #eq(@x, @y) , #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #eq(::(@x_1, @x_2), nil()) -> #false() , #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false() , #eq(nil(), ::(@y_1, @y_2)) -> #false() , #eq(nil(), nil()) -> #true() , #eq(nil(), tuple#2(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), nil()) -> #false() , #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , +(@x, @y) -> #add(@x, @y) , #add(#0(), @y) -> @y , #add(#neg(#s(#0())), @y) -> #pred(@y) , #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y)) , #add(#pos(#s(#0())), @y) -> #succ(@y) , #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y)) , add(@b1, @b2) -> add'(@b1, @b2, #abs(#0())) , add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r) , add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs) , add'#1(nil(), @b2, @r) -> nil() , add'#2(::(@y, @ys), @r, @x, @xs) -> add'#3(sum(@x, @y, @r), @xs, @ys) , add'#2(nil(), @r, @x, @xs) -> nil() , sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r)) , add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r')) , mult(@b1, @b2) -> mult#1(@b1, @b2) , mult#1(::(@x, @xs), @b2) -> mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x) , mult#1(nil(), @b2) -> nil() , mult#2(@zs, @b2, @x) -> mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs) , mult#3(#false(), @b2, @zs) -> @zs , mult#3(#true(), @b2, @zs) -> add(@b2, @zs) , sum#1(@s) -> sum#2(#equal(@s, #0()), @s) , sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s) , sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0())) , sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0()))))) , sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0())) , sum#4(#false()) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0())))) , sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0())))) , #pred(#0()) -> #neg(#s(#0())) , #pred(#neg(#s(@x))) -> #neg(#s(#s(@x))) , #pred(#pos(#s(#0()))) -> #0() , #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x)) , #succ(#0()) -> #pos(#s(#0())) , #succ(#neg(#s(#0()))) -> #0() , #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x)) , #succ(#pos(#s(@x))) -> #pos(#s(#s(@x))) , #and(#false(), #false()) -> #false() , #and(#false(), #true()) -> #false() , #and(#true(), #false()) -> #false() , #and(#true(), #true()) -> #true() } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^2)) We decompose the input problem according to the dependency graph into the upper component { mult^#(@b1, @b2) -> c_13(mult#1^#(@b1, @b2)) , mult#1^#(::(@x, @xs), @b2) -> c_14(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x), mult^#(@xs, @b2)) , mult3^#(@b1, @b2, @b3) -> c_17(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2)) } and lower component { add^#(@b1, @b2) -> c_1(add'^#(@b1, @b2, #abs(#0()))) , add'^#(@b1, @b2, @r) -> c_2(add'#1^#(@b1, @b2, @r)) , add'#1^#(::(@x, @xs), @b2, @r) -> c_3(add'#2^#(@b2, @r, @x, @xs)) , add'#2^#(::(@y, @ys), @r, @x, @xs) -> c_4(add'#3^#(sum(@x, @y, @r), @xs, @ys)) , add'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_5(add'^#(@xs, @ys, @r')) , mult#2^#(@zs, @b2, @x) -> c_15(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs)) , mult#3^#(#true(), @b2, @zs) -> c_16(add^#(@b2, @zs)) } Further, following extension rules are added to the lower component. { mult^#(@b1, @b2) -> mult#1^#(@b1, @b2) , mult#1^#(::(@x, @xs), @b2) -> mult^#(@xs, @b2) , mult#1^#(::(@x, @xs), @b2) -> mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x) , mult3^#(@b1, @b2, @b3) -> mult^#(@b1, @b2) , mult3^#(@b1, @b2, @b3) -> mult^#(mult(@b1, @b2), @b2) } TcT solves the upper component with certificate YES(O(1),O(n^1)). Sub-proof: ---------- We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^1)). Strict DPs: { mult^#(@b1, @b2) -> c_13(mult#1^#(@b1, @b2)) , mult#1^#(::(@x, @xs), @b2) -> c_14(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x), mult^#(@xs, @b2)) , mult3^#(@b1, @b2, @b3) -> c_17(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2)) } Weak Trs: { #abs(#0()) -> #0() , #abs(#neg(@x)) -> #pos(@x) , #abs(#pos(@x)) -> #pos(@x) , #abs(#s(@x)) -> #pos(#s(@x)) , #equal(@x, @y) -> #eq(@x, @y) , #eq(#0(), #0()) -> #true() , #eq(#0(), #neg(@y)) -> #false() , #eq(#0(), #pos(@y)) -> #false() , #eq(#0(), #s(@y)) -> #false() , #eq(#neg(@x), #0()) -> #false() , #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #pos(@y)) -> #false() , #eq(#pos(@x), #0()) -> #false() , #eq(#pos(@x), #neg(@y)) -> #false() , #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y) , #eq(#s(@x), #0()) -> #false() , #eq(#s(@x), #s(@y)) -> #eq(@x, @y) , #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #eq(::(@x_1, @x_2), nil()) -> #false() , #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false() , #eq(nil(), ::(@y_1, @y_2)) -> #false() , #eq(nil(), nil()) -> #true() , #eq(nil(), tuple#2(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), nil()) -> #false() , #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , +(@x, @y) -> #add(@x, @y) , #add(#0(), @y) -> @y , #add(#neg(#s(#0())), @y) -> #pred(@y) , #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y)) , #add(#pos(#s(#0())), @y) -> #succ(@y) , #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y)) , add(@b1, @b2) -> add'(@b1, @b2, #abs(#0())) , add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r) , add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs) , add'#1(nil(), @b2, @r) -> nil() , add'#2(::(@y, @ys), @r, @x, @xs) -> add'#3(sum(@x, @y, @r), @xs, @ys) , add'#2(nil(), @r, @x, @xs) -> nil() , sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r)) , add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r')) , mult(@b1, @b2) -> mult#1(@b1, @b2) , mult#1(::(@x, @xs), @b2) -> mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x) , mult#1(nil(), @b2) -> nil() , mult#2(@zs, @b2, @x) -> mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs) , mult#3(#false(), @b2, @zs) -> @zs , mult#3(#true(), @b2, @zs) -> add(@b2, @zs) , sum#1(@s) -> sum#2(#equal(@s, #0()), @s) , sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s) , sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0())) , sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0()))))) , sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0())) , sum#4(#false()) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0())))) , sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0())))) , #pred(#0()) -> #neg(#s(#0())) , #pred(#neg(#s(@x))) -> #neg(#s(#s(@x))) , #pred(#pos(#s(#0()))) -> #0() , #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x)) , #succ(#0()) -> #pos(#s(#0())) , #succ(#neg(#s(#0()))) -> #0() , #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x)) , #succ(#pos(#s(@x))) -> #pos(#s(#s(@x))) , #and(#false(), #false()) -> #false() , #and(#false(), #true()) -> #false() , #and(#true(), #false()) -> #false() , #and(#true(), #true()) -> #true() } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^1)) Due to missing edges in the dependency-graph, the right-hand sides of following rules could be simplified: { mult#1^#(::(@x, @xs), @b2) -> c_14(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x), mult^#(@xs, @b2)) } We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^1)). Strict DPs: { mult^#(@b1, @b2) -> c_1(mult#1^#(@b1, @b2)) , mult#1^#(::(@x, @xs), @b2) -> c_2(mult^#(@xs, @b2)) , mult3^#(@b1, @b2, @b3) -> c_3(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2)) } Weak Trs: { #abs(#0()) -> #0() , #abs(#neg(@x)) -> #pos(@x) , #abs(#pos(@x)) -> #pos(@x) , #abs(#s(@x)) -> #pos(#s(@x)) , #equal(@x, @y) -> #eq(@x, @y) , #eq(#0(), #0()) -> #true() , #eq(#0(), #neg(@y)) -> #false() , #eq(#0(), #pos(@y)) -> #false() , #eq(#0(), #s(@y)) -> #false() , #eq(#neg(@x), #0()) -> #false() , #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #pos(@y)) -> #false() , #eq(#pos(@x), #0()) -> #false() , #eq(#pos(@x), #neg(@y)) -> #false() , #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y) , #eq(#s(@x), #0()) -> #false() , #eq(#s(@x), #s(@y)) -> #eq(@x, @y) , #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #eq(::(@x_1, @x_2), nil()) -> #false() , #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false() , #eq(nil(), ::(@y_1, @y_2)) -> #false() , #eq(nil(), nil()) -> #true() , #eq(nil(), tuple#2(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), nil()) -> #false() , #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , +(@x, @y) -> #add(@x, @y) , #add(#0(), @y) -> @y , #add(#neg(#s(#0())), @y) -> #pred(@y) , #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y)) , #add(#pos(#s(#0())), @y) -> #succ(@y) , #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y)) , add(@b1, @b2) -> add'(@b1, @b2, #abs(#0())) , add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r) , add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs) , add'#1(nil(), @b2, @r) -> nil() , add'#2(::(@y, @ys), @r, @x, @xs) -> add'#3(sum(@x, @y, @r), @xs, @ys) , add'#2(nil(), @r, @x, @xs) -> nil() , sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r)) , add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r')) , mult(@b1, @b2) -> mult#1(@b1, @b2) , mult#1(::(@x, @xs), @b2) -> mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x) , mult#1(nil(), @b2) -> nil() , mult#2(@zs, @b2, @x) -> mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs) , mult#3(#false(), @b2, @zs) -> @zs , mult#3(#true(), @b2, @zs) -> add(@b2, @zs) , sum#1(@s) -> sum#2(#equal(@s, #0()), @s) , sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s) , sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0())) , sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0()))))) , sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0())) , sum#4(#false()) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0())))) , sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0())))) , #pred(#0()) -> #neg(#s(#0())) , #pred(#neg(#s(@x))) -> #neg(#s(#s(@x))) , #pred(#pos(#s(#0()))) -> #0() , #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x)) , #succ(#0()) -> #pos(#s(#0())) , #succ(#neg(#s(#0()))) -> #0() , #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x)) , #succ(#pos(#s(@x))) -> #pos(#s(#s(@x))) , #and(#false(), #false()) -> #false() , #and(#false(), #true()) -> #false() , #and(#true(), #false()) -> #false() , #and(#true(), #true()) -> #true() } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^1)) We use the processor 'matrix interpretation of dimension 1' to orient following rules strictly. DPs: { 2: mult#1^#(::(@x, @xs), @b2) -> c_2(mult^#(@xs, @b2)) } Trs: { +(@x, @y) -> #add(@x, @y) , sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s) } Sub-proof: ---------- The following argument positions are usable: Uargs(c_1) = {1}, Uargs(c_2) = {1}, Uargs(c_3) = {1, 2} TcT has computed following constructor-based matrix interpretation satisfying not(EDA). [#0] = [0] [#abs](x1) = [0] [#neg](x1) = [0] [#pos](x1) = [0] [#s](x1) = [0] [#equal](x1, x2) = [0] [#eq](x1, x2) = [0] [+](x1, x2) = [1] x2 + [2] [#add](x1, x2) = [0] [add](x1, x2) = [1] x2 + [0] [add'](x1, x2, x3) = [1] x2 + [0] [add'#1](x1, x2, x3) = [1] x2 + [0] [::](x1, x2) = [1] x2 + [2] [add'#2](x1, x2, x3, x4) = [1] x1 + [0] [nil] = [0] [sum](x1, x2, x3) = [2] [add'#3](x1, x2, x3) = [1] x3 + [2] [tuple#2](x1, x2) = [1] [#false] = [0] [#true] = [0] [mult](x1, x2) = [1] x1 + [0] [mult#1](x1, x2) = [1] x1 + [0] [mult#2](x1, x2, x3) = [1] x1 + [0] [mult#3](x1, x2, x3) = [1] x3 + [0] [sum#1](x1) = [1] x1 + [0] [sum#2](x1, x2) = [2] x1 + [1] [sum#3](x1, x2) = [0] [sum#4](x1) = [2] x1 + [0] [#pred](x1) = [0] [#succ](x1) = [0] [#and](x1, x2) = [0] [#EQ] = [0] [#GT] = [0] [#LT] = [0] [#divByZero] = [0] [#underflow] = [0] [#abs^#](x1) = [0] [#equal^#](x1, x2) = [0] [#eq^#](x1, x2) = [0] [#greater^#](x1, x2) = [0] [#ckgt^#](x1) = [0] [#compare^#](x1, x2) = [0] [#less^#](x1, x2) = [0] [#cklt^#](x1) = [0] [*^#](x1, x2) = [0] [#mult^#](x1, x2) = [0] [+^#](x1, x2) = [0] [#add^#](x1, x2) = [0] [-^#](x1, x2) = [0] [#sub^#](x1, x2) = [0] [add^#](x1, x2) = [0] [add'^#](x1, x2, x3) = [0] [add'#1^#](x1, x2, x3) = [0] [add'#2^#](x1, x2, x3, x4) = [0] [add'#3^#](x1, x2, x3) = [0] [sum^#](x1, x2, x3) = [0] [sum#1^#](x1) = [0] [bitToInt^#](x1) = [0] [bitToInt'^#](x1, x2) = [0] [bitToInt'#1^#](x1, x2) = [0] [compare^#](x1, x2) = [0] [compare#1^#](x1, x2) = [0] [compare#2^#](x1, x2, x3) = [0] [compare#3^#](x1, x2, x3) = [0] [compare#4^#](x1, x2, x3, x4) = [0] [compare#5^#](x1, x2, x3) = [0] [compare#6^#](x1) = [0] [diff^#](x1, x2, x3) = [0] [mod^#](x1, x2) = [0] [diff#1^#](x1) = [0] [div^#](x1, x2) = [0] [#div^#](x1, x2) = [0] [leq^#](x1, x2) = [0] [mult^#](x1, x2) = [1] x1 + [1] [mult#1^#](x1, x2) = [1] x1 + [1] [mult#2^#](x1, x2, x3) = [0] [mult#3^#](x1, x2, x3) = [0] [mult3^#](x1, x2, x3) = [2] x1 + [2] x2 + [2] [sub^#](x1, x2) = [0] [sub#1^#](x1) = [0] [sub'^#](x1, x2, x3) = [0] [sub'#1^#](x1, x2, x3) = [0] [sub'#2^#](x1, x2, x3, x4) = [0] [sub'#3^#](x1, x2, x3) = [0] [sub'#4^#](x1, x2) = [0] [sub'#5^#](x1, x2, x3) = [0] [sum#2^#](x1, x2) = [0] [sum#3^#](x1, x2) = [0] [sum#4^#](x1) = [0] [#and^#](x1, x2) = [0] [#natmult^#](x1, x2) = [0] [#pred^#](x1) = [0] [#succ^#](x1) = [0] [#positive^#](x1) = [0] [#natdiv^#](x1, x2) = [0] [#negative^#](x1) = [0] [#natdiv'^#](x1, x2) = [0] [#divsub^#](x1, x2) = [0] [#natadd^#](x1, x2) = [0] [#natsub^#](x1, x2) = [0] [c_13](x1) = [0] [c_14](x1, x2) = [0] [c_17](x1, x2) = [0] [c] = [0] [c_1](x1) = [1] x1 + [0] [c_2](x1) = [1] x1 + [0] [c_3](x1, x2) = [1] x1 + [1] x2 + [0] This order satisfies following ordering constraints [#equal(@x, @y)] = [0] >= [0] = [#eq(@x, @y)] [#eq(#0(), #0())] = [0] >= [0] = [#true()] [#eq(#0(), #neg(@y))] = [0] >= [0] = [#false()] [#eq(#0(), #pos(@y))] = [0] >= [0] = [#false()] [#eq(#0(), #s(@y))] = [0] >= [0] = [#false()] [#eq(#neg(@x), #0())] = [0] >= [0] = [#false()] [#eq(#neg(@x), #neg(@y))] = [0] >= [0] = [#eq(@x, @y)] [#eq(#neg(@x), #pos(@y))] = [0] >= [0] = [#false()] [#eq(#pos(@x), #0())] = [0] >= [0] = [#false()] [#eq(#pos(@x), #neg(@y))] = [0] >= [0] = [#false()] [#eq(#pos(@x), #pos(@y))] = [0] >= [0] = [#eq(@x, @y)] [#eq(#s(@x), #0())] = [0] >= [0] = [#false()] [#eq(#s(@x), #s(@y))] = [0] >= [0] = [#eq(@x, @y)] [#eq(::(@x_1, @x_2), ::(@y_1, @y_2))] = [0] >= [0] = [#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))] [#eq(::(@x_1, @x_2), nil())] = [0] >= [0] = [#false()] [#eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2))] = [0] >= [0] = [#false()] [#eq(nil(), ::(@y_1, @y_2))] = [0] >= [0] = [#false()] [#eq(nil(), nil())] = [0] >= [0] = [#true()] [#eq(nil(), tuple#2(@y_1, @y_2))] = [0] >= [0] = [#false()] [#eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2))] = [0] >= [0] = [#false()] [#eq(tuple#2(@x_1, @x_2), nil())] = [0] >= [0] = [#false()] [#eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2))] = [0] >= [0] = [#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))] [add(@b1, @b2)] = [1] @b2 + [0] >= [1] @b2 + [0] = [add'(@b1, @b2, #abs(#0()))] [add'(@b1, @b2, @r)] = [1] @b2 + [0] >= [1] @b2 + [0] = [add'#1(@b1, @b2, @r)] [add'#1(::(@x, @xs), @b2, @r)] = [1] @b2 + [0] >= [1] @b2 + [0] = [add'#2(@b2, @r, @x, @xs)] [add'#1(nil(), @b2, @r)] = [1] @b2 + [0] >= [0] = [nil()] [add'#2(::(@y, @ys), @r, @x, @xs)] = [1] @ys + [2] >= [1] @ys + [2] = [add'#3(sum(@x, @y, @r), @xs, @ys)] [add'#2(nil(), @r, @x, @xs)] = [0] >= [0] = [nil()] [add'#3(tuple#2(@z, @r'), @xs, @ys)] = [1] @ys + [2] >= [1] @ys + [2] = [::(@z, add'(@xs, @ys, @r'))] [mult(@b1, @b2)] = [1] @b1 + [0] >= [1] @b1 + [0] = [mult#1(@b1, @b2)] [mult#1(::(@x, @xs), @b2)] = [1] @xs + [2] >= [1] @xs + [2] = [mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x)] [mult#1(nil(), @b2)] = [0] >= [0] = [nil()] [mult#2(@zs, @b2, @x)] = [1] @zs + [0] >= [1] @zs + [0] = [mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs)] [mult#3(#false(), @b2, @zs)] = [1] @zs + [0] >= [1] @zs + [0] = [@zs] [mult#3(#true(), @b2, @zs)] = [1] @zs + [0] >= [1] @zs + [0] = [add(@b2, @zs)] [#and(#false(), #false())] = [0] >= [0] = [#false()] [#and(#false(), #true())] = [0] >= [0] = [#false()] [#and(#true(), #false())] = [0] >= [0] = [#false()] [#and(#true(), #true())] = [0] >= [0] = [#true()] [mult^#(@b1, @b2)] = [1] @b1 + [1] >= [1] @b1 + [1] = [c_1(mult#1^#(@b1, @b2))] [mult#1^#(::(@x, @xs), @b2)] = [1] @xs + [3] > [1] @xs + [1] = [c_2(mult^#(@xs, @b2))] [mult3^#(@b1, @b2, @b3)] = [2] @b1 + [2] @b2 + [2] >= [2] @b1 + [2] = [c_3(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2))] Consider the set of all dependency pairs DPs: { 1: mult^#(@b1, @b2) -> c_1(mult#1^#(@b1, @b2)) , 2: mult#1^#(::(@x, @xs), @b2) -> c_2(mult^#(@xs, @b2)) , 3: mult3^#(@b1, @b2, @b3) -> c_3(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2)) } Processor 'matrix interpretation of dimension 1' induces the complexity certificate YES(?,O(n^1)) on application of dependency pairs {2}. These cover all (indirect) predecessors of dependency pairs {1,2,3}, their number of application is equally bounded. The dependency pairs are shifted into the corresponding weak component(s). We apply the transformation 'removetails' on the sub-problem: Weak DPs: { mult^#(@b1, @b2) -> c_1(mult#1^#(@b1, @b2)) , mult#1^#(::(@x, @xs), @b2) -> c_2(mult^#(@xs, @b2)) , mult3^#(@b1, @b2, @b3) -> c_3(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2)) } Weak Trs: { #abs(#0()) -> #0() , #abs(#neg(@x)) -> #pos(@x) , #abs(#pos(@x)) -> #pos(@x) , #abs(#s(@x)) -> #pos(#s(@x)) , #equal(@x, @y) -> #eq(@x, @y) , #eq(#0(), #0()) -> #true() , #eq(#0(), #neg(@y)) -> #false() , #eq(#0(), #pos(@y)) -> #false() , #eq(#0(), #s(@y)) -> #false() , #eq(#neg(@x), #0()) -> #false() , #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #pos(@y)) -> #false() , #eq(#pos(@x), #0()) -> #false() , #eq(#pos(@x), #neg(@y)) -> #false() , #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y) , #eq(#s(@x), #0()) -> #false() , #eq(#s(@x), #s(@y)) -> #eq(@x, @y) , #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #eq(::(@x_1, @x_2), nil()) -> #false() , #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false() , #eq(nil(), ::(@y_1, @y_2)) -> #false() , #eq(nil(), nil()) -> #true() , #eq(nil(), tuple#2(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), nil()) -> #false() , #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , +(@x, @y) -> #add(@x, @y) , #add(#0(), @y) -> @y , #add(#neg(#s(#0())), @y) -> #pred(@y) , #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y)) , #add(#pos(#s(#0())), @y) -> #succ(@y) , #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y)) , add(@b1, @b2) -> add'(@b1, @b2, #abs(#0())) , add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r) , add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs) , add'#1(nil(), @b2, @r) -> nil() , add'#2(::(@y, @ys), @r, @x, @xs) -> add'#3(sum(@x, @y, @r), @xs, @ys) , add'#2(nil(), @r, @x, @xs) -> nil() , sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r)) , add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r')) , mult(@b1, @b2) -> mult#1(@b1, @b2) , mult#1(::(@x, @xs), @b2) -> mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x) , mult#1(nil(), @b2) -> nil() , mult#2(@zs, @b2, @x) -> mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs) , mult#3(#false(), @b2, @zs) -> @zs , mult#3(#true(), @b2, @zs) -> add(@b2, @zs) , sum#1(@s) -> sum#2(#equal(@s, #0()), @s) , sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s) , sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0())) , sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0()))))) , sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0())) , sum#4(#false()) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0())))) , sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0())))) , #pred(#0()) -> #neg(#s(#0())) , #pred(#neg(#s(@x))) -> #neg(#s(#s(@x))) , #pred(#pos(#s(#0()))) -> #0() , #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x)) , #succ(#0()) -> #pos(#s(#0())) , #succ(#neg(#s(#0()))) -> #0() , #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x)) , #succ(#pos(#s(@x))) -> #pos(#s(#s(@x))) , #and(#false(), #false()) -> #false() , #and(#false(), #true()) -> #false() , #and(#true(), #false()) -> #false() , #and(#true(), #true()) -> #true() } StartTerms: basic terms Strategy: innermost The following weak DPs constitute a sub-graph of the DG that is closed under successors. The DPs are removed. { mult^#(@b1, @b2) -> c_1(mult#1^#(@b1, @b2)) , mult#1^#(::(@x, @xs), @b2) -> c_2(mult^#(@xs, @b2)) , mult3^#(@b1, @b2, @b3) -> c_3(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2)) } We apply the transformation 'usablerules' on the sub-problem: Weak Trs: { #abs(#0()) -> #0() , #abs(#neg(@x)) -> #pos(@x) , #abs(#pos(@x)) -> #pos(@x) , #abs(#s(@x)) -> #pos(#s(@x)) , #equal(@x, @y) -> #eq(@x, @y) , #eq(#0(), #0()) -> #true() , #eq(#0(), #neg(@y)) -> #false() , #eq(#0(), #pos(@y)) -> #false() , #eq(#0(), #s(@y)) -> #false() , #eq(#neg(@x), #0()) -> #false() , #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #pos(@y)) -> #false() , #eq(#pos(@x), #0()) -> #false() , #eq(#pos(@x), #neg(@y)) -> #false() , #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y) , #eq(#s(@x), #0()) -> #false() , #eq(#s(@x), #s(@y)) -> #eq(@x, @y) , #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #eq(::(@x_1, @x_2), nil()) -> #false() , #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false() , #eq(nil(), ::(@y_1, @y_2)) -> #false() , #eq(nil(), nil()) -> #true() , #eq(nil(), tuple#2(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), nil()) -> #false() , #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , +(@x, @y) -> #add(@x, @y) , #add(#0(), @y) -> @y , #add(#neg(#s(#0())), @y) -> #pred(@y) , #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y)) , #add(#pos(#s(#0())), @y) -> #succ(@y) , #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y)) , add(@b1, @b2) -> add'(@b1, @b2, #abs(#0())) , add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r) , add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs) , add'#1(nil(), @b2, @r) -> nil() , add'#2(::(@y, @ys), @r, @x, @xs) -> add'#3(sum(@x, @y, @r), @xs, @ys) , add'#2(nil(), @r, @x, @xs) -> nil() , sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r)) , add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r')) , mult(@b1, @b2) -> mult#1(@b1, @b2) , mult#1(::(@x, @xs), @b2) -> mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x) , mult#1(nil(), @b2) -> nil() , mult#2(@zs, @b2, @x) -> mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs) , mult#3(#false(), @b2, @zs) -> @zs , mult#3(#true(), @b2, @zs) -> add(@b2, @zs) , sum#1(@s) -> sum#2(#equal(@s, #0()), @s) , sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s) , sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0())) , sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0()))))) , sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0())) , sum#4(#false()) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0())))) , sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0())))) , #pred(#0()) -> #neg(#s(#0())) , #pred(#neg(#s(@x))) -> #neg(#s(#s(@x))) , #pred(#pos(#s(#0()))) -> #0() , #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x)) , #succ(#0()) -> #pos(#s(#0())) , #succ(#neg(#s(#0()))) -> #0() , #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x)) , #succ(#pos(#s(@x))) -> #pos(#s(#s(@x))) , #and(#false(), #false()) -> #false() , #and(#false(), #true()) -> #false() , #and(#true(), #false()) -> #false() , #and(#true(), #true()) -> #true() } StartTerms: basic terms Strategy: innermost No rule is usable, rules are removed from the input problem. We are left with following problem, upon which TcT provides the certificate YES(O(1),O(1)). Rules: Empty Obligation: innermost runtime complexity Answer: YES(O(1),O(1)) Empty rules are trivially bounded We return to the main proof. We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^1)). Strict DPs: { add^#(@b1, @b2) -> c_1(add'^#(@b1, @b2, #abs(#0()))) , add'^#(@b1, @b2, @r) -> c_2(add'#1^#(@b1, @b2, @r)) , add'#1^#(::(@x, @xs), @b2, @r) -> c_3(add'#2^#(@b2, @r, @x, @xs)) , add'#2^#(::(@y, @ys), @r, @x, @xs) -> c_4(add'#3^#(sum(@x, @y, @r), @xs, @ys)) , add'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_5(add'^#(@xs, @ys, @r')) , mult#2^#(@zs, @b2, @x) -> c_15(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs)) , mult#3^#(#true(), @b2, @zs) -> c_16(add^#(@b2, @zs)) } Weak DPs: { mult^#(@b1, @b2) -> mult#1^#(@b1, @b2) , mult#1^#(::(@x, @xs), @b2) -> mult^#(@xs, @b2) , mult#1^#(::(@x, @xs), @b2) -> mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x) , mult3^#(@b1, @b2, @b3) -> mult^#(@b1, @b2) , mult3^#(@b1, @b2, @b3) -> mult^#(mult(@b1, @b2), @b2) } Weak Trs: { #abs(#0()) -> #0() , #abs(#neg(@x)) -> #pos(@x) , #abs(#pos(@x)) -> #pos(@x) , #abs(#s(@x)) -> #pos(#s(@x)) , #equal(@x, @y) -> #eq(@x, @y) , #eq(#0(), #0()) -> #true() , #eq(#0(), #neg(@y)) -> #false() , #eq(#0(), #pos(@y)) -> #false() , #eq(#0(), #s(@y)) -> #false() , #eq(#neg(@x), #0()) -> #false() , #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #pos(@y)) -> #false() , #eq(#pos(@x), #0()) -> #false() , #eq(#pos(@x), #neg(@y)) -> #false() , #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y) , #eq(#s(@x), #0()) -> #false() , #eq(#s(@x), #s(@y)) -> #eq(@x, @y) , #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #eq(::(@x_1, @x_2), nil()) -> #false() , #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false() , #eq(nil(), ::(@y_1, @y_2)) -> #false() , #eq(nil(), nil()) -> #true() , #eq(nil(), tuple#2(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), nil()) -> #false() , #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , +(@x, @y) -> #add(@x, @y) , #add(#0(), @y) -> @y , #add(#neg(#s(#0())), @y) -> #pred(@y) , #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y)) , #add(#pos(#s(#0())), @y) -> #succ(@y) , #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y)) , add(@b1, @b2) -> add'(@b1, @b2, #abs(#0())) , add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r) , add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs) , add'#1(nil(), @b2, @r) -> nil() , add'#2(::(@y, @ys), @r, @x, @xs) -> add'#3(sum(@x, @y, @r), @xs, @ys) , add'#2(nil(), @r, @x, @xs) -> nil() , sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r)) , add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r')) , mult(@b1, @b2) -> mult#1(@b1, @b2) , mult#1(::(@x, @xs), @b2) -> mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x) , mult#1(nil(), @b2) -> nil() , mult#2(@zs, @b2, @x) -> mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs) , mult#3(#false(), @b2, @zs) -> @zs , mult#3(#true(), @b2, @zs) -> add(@b2, @zs) , sum#1(@s) -> sum#2(#equal(@s, #0()), @s) , sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s) , sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0())) , sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0()))))) , sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0())) , sum#4(#false()) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0())))) , sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0())))) , #pred(#0()) -> #neg(#s(#0())) , #pred(#neg(#s(@x))) -> #neg(#s(#s(@x))) , #pred(#pos(#s(#0()))) -> #0() , #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x)) , #succ(#0()) -> #pos(#s(#0())) , #succ(#neg(#s(#0()))) -> #0() , #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x)) , #succ(#pos(#s(@x))) -> #pos(#s(#s(@x))) , #and(#false(), #false()) -> #false() , #and(#false(), #true()) -> #false() , #and(#true(), #false()) -> #false() , #and(#true(), #true()) -> #true() } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^1)) Consider the dependency graph 1: add^#(@b1, @b2) -> c_1(add'^#(@b1, @b2, #abs(#0()))) -->_1 add'^#(@b1, @b2, @r) -> c_2(add'#1^#(@b1, @b2, @r)) :2 2: add'^#(@b1, @b2, @r) -> c_2(add'#1^#(@b1, @b2, @r)) -->_1 add'#1^#(::(@x, @xs), @b2, @r) -> c_3(add'#2^#(@b2, @r, @x, @xs)) :3 3: add'#1^#(::(@x, @xs), @b2, @r) -> c_3(add'#2^#(@b2, @r, @x, @xs)) -->_1 add'#2^#(::(@y, @ys), @r, @x, @xs) -> c_4(add'#3^#(sum(@x, @y, @r), @xs, @ys)) :4 4: add'#2^#(::(@y, @ys), @r, @x, @xs) -> c_4(add'#3^#(sum(@x, @y, @r), @xs, @ys)) -->_1 add'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_5(add'^#(@xs, @ys, @r')) :5 5: add'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_5(add'^#(@xs, @ys, @r')) -->_1 add'^#(@b1, @b2, @r) -> c_2(add'#1^#(@b1, @b2, @r)) :2 6: mult#2^#(@zs, @b2, @x) -> c_15(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs)) -->_1 mult#3^#(#true(), @b2, @zs) -> c_16(add^#(@b2, @zs)) :7 7: mult#3^#(#true(), @b2, @zs) -> c_16(add^#(@b2, @zs)) -->_1 add^#(@b1, @b2) -> c_1(add'^#(@b1, @b2, #abs(#0()))) :1 8: mult^#(@b1, @b2) -> mult#1^#(@b1, @b2) -->_1 mult#1^#(::(@x, @xs), @b2) -> mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x) :10 -->_1 mult#1^#(::(@x, @xs), @b2) -> mult^#(@xs, @b2) :9 9: mult#1^#(::(@x, @xs), @b2) -> mult^#(@xs, @b2) -->_1 mult^#(@b1, @b2) -> mult#1^#(@b1, @b2) :8 10: mult#1^#(::(@x, @xs), @b2) -> mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x) -->_1 mult#2^#(@zs, @b2, @x) -> c_15(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs)) :6 11: mult3^#(@b1, @b2, @b3) -> mult^#(@b1, @b2) -->_1 mult^#(@b1, @b2) -> mult#1^#(@b1, @b2) :8 12: mult3^#(@b1, @b2, @b3) -> mult^#(mult(@b1, @b2), @b2) -->_1 mult^#(@b1, @b2) -> mult#1^#(@b1, @b2) :8 Following roots of the dependency graph are removed, as the considered set of starting terms is closed under reduction with respect to these rules (modulo compound contexts). { mult3^#(@b1, @b2, @b3) -> mult^#(@b1, @b2) } We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^1)). Strict DPs: { add^#(@b1, @b2) -> c_1(add'^#(@b1, @b2, #abs(#0()))) , add'^#(@b1, @b2, @r) -> c_2(add'#1^#(@b1, @b2, @r)) , add'#1^#(::(@x, @xs), @b2, @r) -> c_3(add'#2^#(@b2, @r, @x, @xs)) , add'#2^#(::(@y, @ys), @r, @x, @xs) -> c_4(add'#3^#(sum(@x, @y, @r), @xs, @ys)) , add'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_5(add'^#(@xs, @ys, @r')) , mult#2^#(@zs, @b2, @x) -> c_15(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs)) , mult#3^#(#true(), @b2, @zs) -> c_16(add^#(@b2, @zs)) } Weak DPs: { mult^#(@b1, @b2) -> mult#1^#(@b1, @b2) , mult#1^#(::(@x, @xs), @b2) -> mult^#(@xs, @b2) , mult#1^#(::(@x, @xs), @b2) -> mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x) , mult3^#(@b1, @b2, @b3) -> mult^#(mult(@b1, @b2), @b2) } Weak Trs: { #abs(#0()) -> #0() , #abs(#neg(@x)) -> #pos(@x) , #abs(#pos(@x)) -> #pos(@x) , #abs(#s(@x)) -> #pos(#s(@x)) , #equal(@x, @y) -> #eq(@x, @y) , #eq(#0(), #0()) -> #true() , #eq(#0(), #neg(@y)) -> #false() , #eq(#0(), #pos(@y)) -> #false() , #eq(#0(), #s(@y)) -> #false() , #eq(#neg(@x), #0()) -> #false() , #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #pos(@y)) -> #false() , #eq(#pos(@x), #0()) -> #false() , #eq(#pos(@x), #neg(@y)) -> #false() , #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y) , #eq(#s(@x), #0()) -> #false() , #eq(#s(@x), #s(@y)) -> #eq(@x, @y) , #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #eq(::(@x_1, @x_2), nil()) -> #false() , #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false() , #eq(nil(), ::(@y_1, @y_2)) -> #false() , #eq(nil(), nil()) -> #true() , #eq(nil(), tuple#2(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), nil()) -> #false() , #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , +(@x, @y) -> #add(@x, @y) , #add(#0(), @y) -> @y , #add(#neg(#s(#0())), @y) -> #pred(@y) , #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y)) , #add(#pos(#s(#0())), @y) -> #succ(@y) , #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y)) , add(@b1, @b2) -> add'(@b1, @b2, #abs(#0())) , add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r) , add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs) , add'#1(nil(), @b2, @r) -> nil() , add'#2(::(@y, @ys), @r, @x, @xs) -> add'#3(sum(@x, @y, @r), @xs, @ys) , add'#2(nil(), @r, @x, @xs) -> nil() , sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r)) , add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r')) , mult(@b1, @b2) -> mult#1(@b1, @b2) , mult#1(::(@x, @xs), @b2) -> mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x) , mult#1(nil(), @b2) -> nil() , mult#2(@zs, @b2, @x) -> mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs) , mult#3(#false(), @b2, @zs) -> @zs , mult#3(#true(), @b2, @zs) -> add(@b2, @zs) , sum#1(@s) -> sum#2(#equal(@s, #0()), @s) , sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s) , sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0())) , sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0()))))) , sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0())) , sum#4(#false()) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0())))) , sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0())))) , #pred(#0()) -> #neg(#s(#0())) , #pred(#neg(#s(@x))) -> #neg(#s(#s(@x))) , #pred(#pos(#s(#0()))) -> #0() , #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x)) , #succ(#0()) -> #pos(#s(#0())) , #succ(#neg(#s(#0()))) -> #0() , #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x)) , #succ(#pos(#s(@x))) -> #pos(#s(#s(@x))) , #and(#false(), #false()) -> #false() , #and(#false(), #true()) -> #false() , #and(#true(), #false()) -> #false() , #and(#true(), #true()) -> #true() } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^1)) We use the processor 'matrix interpretation of dimension 1' to orient following rules strictly. DPs: { 3: add'#1^#(::(@x, @xs), @b2, @r) -> c_3(add'#2^#(@b2, @r, @x, @xs)) , 10: mult#1^#(::(@x, @xs), @b2) -> mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x) } Trs: { add(@b1, @b2) -> add'(@b1, @b2, #abs(#0())) , add'#1(nil(), @b2, @r) -> nil() , add'#2(::(@y, @ys), @r, @x, @xs) -> add'#3(sum(@x, @y, @r), @xs, @ys) , add'#2(nil(), @r, @x, @xs) -> nil() , mult#1(::(@x, @xs), @b2) -> mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x) , sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0())) } Sub-proof: ---------- The following argument positions are usable: Uargs(c_1) = {1}, Uargs(c_2) = {1}, Uargs(c_3) = {1}, Uargs(c_4) = {1}, Uargs(c_5) = {1}, Uargs(c_15) = {1}, Uargs(c_16) = {1} TcT has computed following constructor-based matrix interpretation satisfying not(EDA). [#0] = [0] [#abs](x1) = [0] [#neg](x1) = [0] [#pos](x1) = [0] [#s](x1) = [0] [#equal](x1, x2) = [0] [#eq](x1, x2) = [0] [+](x1, x2) = [0] [#add](x1, x2) = [1] x2 + [0] [add](x1, x2) = [1] [add'](x1, x2, x3) = [0] [add'#1](x1, x2, x3) = [1] x1 + [1] [::](x1, x2) = [1] x2 + [1] [add'#2](x1, x2, x3, x4) = [1] x1 + [1] [nil] = [0] [sum](x1, x2, x3) = [0] [add'#3](x1, x2, x3) = [0] [tuple#2](x1, x2) = [0] [#false] = [0] [#true] = [1] [mult](x1, x2) = [0] [mult#1](x1, x2) = [1] x1 + [0] [mult#2](x1, x2, x3) = [0] [mult#3](x1, x2, x3) = [1] x3 + [0] [sum#1](x1) = [0] [sum#2](x1, x2) = [0] [sum#3](x1, x2) = [1] x1 + [0] [sum#4](x1) = [0] [#pred](x1) = [0] [#succ](x1) = [0] [#and](x1, x2) = [0] [#EQ] = [0] [#GT] = [0] [#LT] = [0] [#divByZero] = [0] [#underflow] = [0] [#abs^#](x1) = [0] [#equal^#](x1, x2) = [0] [#eq^#](x1, x2) = [0] [#greater^#](x1, x2) = [0] [#ckgt^#](x1) = [0] [#compare^#](x1, x2) = [0] [#less^#](x1, x2) = [0] [#cklt^#](x1) = [0] [*^#](x1, x2) = [0] [#mult^#](x1, x2) = [0] [+^#](x1, x2) = [0] [#add^#](x1, x2) = [0] [-^#](x1, x2) = [0] [#sub^#](x1, x2) = [0] [add^#](x1, x2) = [1] x1 + [0] [add'^#](x1, x2, x3) = [1] x1 + [0] [add'#1^#](x1, x2, x3) = [1] x1 + [0] [add'#2^#](x1, x2, x3, x4) = [1] x4 + [0] [add'#3^#](x1, x2, x3) = [1] x2 + [0] [sum^#](x1, x2, x3) = [0] [sum#1^#](x1) = [0] [bitToInt^#](x1) = [0] [bitToInt'^#](x1, x2) = [0] [bitToInt'#1^#](x1, x2) = [0] [compare^#](x1, x2) = [0] [compare#1^#](x1, x2) = [0] [compare#2^#](x1, x2, x3) = [0] [compare#3^#](x1, x2, x3) = [0] [compare#4^#](x1, x2, x3, x4) = [0] [compare#5^#](x1, x2, x3) = [0] [compare#6^#](x1) = [0] [diff^#](x1, x2, x3) = [0] [mod^#](x1, x2) = [0] [diff#1^#](x1) = [0] [div^#](x1, x2) = [0] [#div^#](x1, x2) = [0] [leq^#](x1, x2) = [0] [mult^#](x1, x2) = [1] x2 + [1] [mult#1^#](x1, x2) = [1] x2 + [1] [mult#2^#](x1, x2, x3) = [1] x2 + [0] [mult#3^#](x1, x2, x3) = [1] x2 + [0] [mult3^#](x1, x2, x3) = [1] x1 + [1] x2 + [1] [sub^#](x1, x2) = [0] [sub#1^#](x1) = [0] [sub'^#](x1, x2, x3) = [0] [sub'#1^#](x1, x2, x3) = [0] [sub'#2^#](x1, x2, x3, x4) = [0] [sub'#3^#](x1, x2, x3) = [0] [sub'#4^#](x1, x2) = [0] [sub'#5^#](x1, x2, x3) = [0] [sum#2^#](x1, x2) = [0] [sum#3^#](x1, x2) = [0] [sum#4^#](x1) = [0] [#and^#](x1, x2) = [0] [#natmult^#](x1, x2) = [0] [#pred^#](x1) = [0] [#succ^#](x1) = [0] [#positive^#](x1) = [0] [#natdiv^#](x1, x2) = [0] [#negative^#](x1) = [0] [#natdiv'^#](x1, x2) = [0] [#divsub^#](x1, x2) = [0] [#natadd^#](x1, x2) = [0] [#natsub^#](x1, x2) = [0] [c_1](x1) = [1] x1 + [0] [c_2](x1) = [1] x1 + [0] [c_3](x1) = [1] x1 + [0] [c_4](x1) = [1] x1 + [0] [c_5](x1) = [1] x1 + [0] [c_15](x1) = [1] x1 + [0] [c_16](x1) = [1] x1 + [0] This order satisfies following ordering constraints [add^#(@b1, @b2)] = [1] @b1 + [0] >= [1] @b1 + [0] = [c_1(add'^#(@b1, @b2, #abs(#0())))] [add'^#(@b1, @b2, @r)] = [1] @b1 + [0] >= [1] @b1 + [0] = [c_2(add'#1^#(@b1, @b2, @r))] [add'#1^#(::(@x, @xs), @b2, @r)] = [1] @xs + [1] > [1] @xs + [0] = [c_3(add'#2^#(@b2, @r, @x, @xs))] [add'#2^#(::(@y, @ys), @r, @x, @xs)] = [1] @xs + [0] >= [1] @xs + [0] = [c_4(add'#3^#(sum(@x, @y, @r), @xs, @ys))] [add'#3^#(tuple#2(@z, @r'), @xs, @ys)] = [1] @xs + [0] >= [1] @xs + [0] = [c_5(add'^#(@xs, @ys, @r'))] [mult^#(@b1, @b2)] = [1] @b2 + [1] >= [1] @b2 + [1] = [mult#1^#(@b1, @b2)] [mult#1^#(::(@x, @xs), @b2)] = [1] @b2 + [1] >= [1] @b2 + [1] = [mult^#(@xs, @b2)] [mult#1^#(::(@x, @xs), @b2)] = [1] @b2 + [1] > [1] @b2 + [0] = [mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x)] [mult#2^#(@zs, @b2, @x)] = [1] @b2 + [0] >= [1] @b2 + [0] = [c_15(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs))] [mult#3^#(#true(), @b2, @zs)] = [1] @b2 + [0] >= [1] @b2 + [0] = [c_16(add^#(@b2, @zs))] [mult3^#(@b1, @b2, @b3)] = [1] @b1 + [1] @b2 + [1] >= [1] @b2 + [1] = [mult^#(mult(@b1, @b2), @b2)] Consider the set of all dependency pairs DPs: { 1: add^#(@b1, @b2) -> c_1(add'^#(@b1, @b2, #abs(#0()))) , 2: add'^#(@b1, @b2, @r) -> c_2(add'#1^#(@b1, @b2, @r)) , 3: add'#1^#(::(@x, @xs), @b2, @r) -> c_3(add'#2^#(@b2, @r, @x, @xs)) , 4: add'#2^#(::(@y, @ys), @r, @x, @xs) -> c_4(add'#3^#(sum(@x, @y, @r), @xs, @ys)) , 5: add'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_5(add'^#(@xs, @ys, @r')) , 6: mult#2^#(@zs, @b2, @x) -> c_15(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs)) , 7: mult#3^#(#true(), @b2, @zs) -> c_16(add^#(@b2, @zs)) , 8: mult^#(@b1, @b2) -> mult#1^#(@b1, @b2) , 9: mult#1^#(::(@x, @xs), @b2) -> mult^#(@xs, @b2) , 10: mult#1^#(::(@x, @xs), @b2) -> mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x) , 11: mult3^#(@b1, @b2, @b3) -> mult^#(mult(@b1, @b2), @b2) } Processor 'matrix interpretation of dimension 1' induces the complexity certificate YES(?,O(n^1)) on application of dependency pairs {3,10}. These cover all (indirect) predecessors of dependency pairs {1,2,3,4,5,6,7,10,11}, their number of application is equally bounded. The dependency pairs are shifted into the corresponding weak component(s). We apply the transformation 'removetails' on the sub-problem: Weak DPs: { add^#(@b1, @b2) -> c_1(add'^#(@b1, @b2, #abs(#0()))) , add'^#(@b1, @b2, @r) -> c_2(add'#1^#(@b1, @b2, @r)) , add'#1^#(::(@x, @xs), @b2, @r) -> c_3(add'#2^#(@b2, @r, @x, @xs)) , add'#2^#(::(@y, @ys), @r, @x, @xs) -> c_4(add'#3^#(sum(@x, @y, @r), @xs, @ys)) , add'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_5(add'^#(@xs, @ys, @r')) , mult^#(@b1, @b2) -> mult#1^#(@b1, @b2) , mult#1^#(::(@x, @xs), @b2) -> mult^#(@xs, @b2) , mult#1^#(::(@x, @xs), @b2) -> mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x) , mult#2^#(@zs, @b2, @x) -> c_15(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs)) , mult#3^#(#true(), @b2, @zs) -> c_16(add^#(@b2, @zs)) , mult3^#(@b1, @b2, @b3) -> mult^#(mult(@b1, @b2), @b2) } Weak Trs: { #abs(#0()) -> #0() , #abs(#neg(@x)) -> #pos(@x) , #abs(#pos(@x)) -> #pos(@x) , #abs(#s(@x)) -> #pos(#s(@x)) , #equal(@x, @y) -> #eq(@x, @y) , #eq(#0(), #0()) -> #true() , #eq(#0(), #neg(@y)) -> #false() , #eq(#0(), #pos(@y)) -> #false() , #eq(#0(), #s(@y)) -> #false() , #eq(#neg(@x), #0()) -> #false() , #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #pos(@y)) -> #false() , #eq(#pos(@x), #0()) -> #false() , #eq(#pos(@x), #neg(@y)) -> #false() , #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y) , #eq(#s(@x), #0()) -> #false() , #eq(#s(@x), #s(@y)) -> #eq(@x, @y) , #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #eq(::(@x_1, @x_2), nil()) -> #false() , #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false() , #eq(nil(), ::(@y_1, @y_2)) -> #false() , #eq(nil(), nil()) -> #true() , #eq(nil(), tuple#2(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), nil()) -> #false() , #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , +(@x, @y) -> #add(@x, @y) , #add(#0(), @y) -> @y , #add(#neg(#s(#0())), @y) -> #pred(@y) , #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y)) , #add(#pos(#s(#0())), @y) -> #succ(@y) , #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y)) , add(@b1, @b2) -> add'(@b1, @b2, #abs(#0())) , add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r) , add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs) , add'#1(nil(), @b2, @r) -> nil() , add'#2(::(@y, @ys), @r, @x, @xs) -> add'#3(sum(@x, @y, @r), @xs, @ys) , add'#2(nil(), @r, @x, @xs) -> nil() , sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r)) , add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r')) , mult(@b1, @b2) -> mult#1(@b1, @b2) , mult#1(::(@x, @xs), @b2) -> mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x) , mult#1(nil(), @b2) -> nil() , mult#2(@zs, @b2, @x) -> mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs) , mult#3(#false(), @b2, @zs) -> @zs , mult#3(#true(), @b2, @zs) -> add(@b2, @zs) , sum#1(@s) -> sum#2(#equal(@s, #0()), @s) , sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s) , sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0())) , sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0()))))) , sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0())) , sum#4(#false()) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0())))) , sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0())))) , #pred(#0()) -> #neg(#s(#0())) , #pred(#neg(#s(@x))) -> #neg(#s(#s(@x))) , #pred(#pos(#s(#0()))) -> #0() , #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x)) , #succ(#0()) -> #pos(#s(#0())) , #succ(#neg(#s(#0()))) -> #0() , #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x)) , #succ(#pos(#s(@x))) -> #pos(#s(#s(@x))) , #and(#false(), #false()) -> #false() , #and(#false(), #true()) -> #false() , #and(#true(), #false()) -> #false() , #and(#true(), #true()) -> #true() } StartTerms: basic terms Strategy: innermost The following weak DPs constitute a sub-graph of the DG that is closed under successors. The DPs are removed. { add^#(@b1, @b2) -> c_1(add'^#(@b1, @b2, #abs(#0()))) , add'^#(@b1, @b2, @r) -> c_2(add'#1^#(@b1, @b2, @r)) , add'#1^#(::(@x, @xs), @b2, @r) -> c_3(add'#2^#(@b2, @r, @x, @xs)) , add'#2^#(::(@y, @ys), @r, @x, @xs) -> c_4(add'#3^#(sum(@x, @y, @r), @xs, @ys)) , add'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_5(add'^#(@xs, @ys, @r')) , mult^#(@b1, @b2) -> mult#1^#(@b1, @b2) , mult#1^#(::(@x, @xs), @b2) -> mult^#(@xs, @b2) , mult#1^#(::(@x, @xs), @b2) -> mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x) , mult#2^#(@zs, @b2, @x) -> c_15(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs)) , mult#3^#(#true(), @b2, @zs) -> c_16(add^#(@b2, @zs)) , mult3^#(@b1, @b2, @b3) -> mult^#(mult(@b1, @b2), @b2) } We apply the transformation 'usablerules' on the sub-problem: Weak Trs: { #abs(#0()) -> #0() , #abs(#neg(@x)) -> #pos(@x) , #abs(#pos(@x)) -> #pos(@x) , #abs(#s(@x)) -> #pos(#s(@x)) , #equal(@x, @y) -> #eq(@x, @y) , #eq(#0(), #0()) -> #true() , #eq(#0(), #neg(@y)) -> #false() , #eq(#0(), #pos(@y)) -> #false() , #eq(#0(), #s(@y)) -> #false() , #eq(#neg(@x), #0()) -> #false() , #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #pos(@y)) -> #false() , #eq(#pos(@x), #0()) -> #false() , #eq(#pos(@x), #neg(@y)) -> #false() , #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y) , #eq(#s(@x), #0()) -> #false() , #eq(#s(@x), #s(@y)) -> #eq(@x, @y) , #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #eq(::(@x_1, @x_2), nil()) -> #false() , #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false() , #eq(nil(), ::(@y_1, @y_2)) -> #false() , #eq(nil(), nil()) -> #true() , #eq(nil(), tuple#2(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), nil()) -> #false() , #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , +(@x, @y) -> #add(@x, @y) , #add(#0(), @y) -> @y , #add(#neg(#s(#0())), @y) -> #pred(@y) , #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y)) , #add(#pos(#s(#0())), @y) -> #succ(@y) , #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y)) , add(@b1, @b2) -> add'(@b1, @b2, #abs(#0())) , add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r) , add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs) , add'#1(nil(), @b2, @r) -> nil() , add'#2(::(@y, @ys), @r, @x, @xs) -> add'#3(sum(@x, @y, @r), @xs, @ys) , add'#2(nil(), @r, @x, @xs) -> nil() , sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r)) , add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r')) , mult(@b1, @b2) -> mult#1(@b1, @b2) , mult#1(::(@x, @xs), @b2) -> mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x) , mult#1(nil(), @b2) -> nil() , mult#2(@zs, @b2, @x) -> mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs) , mult#3(#false(), @b2, @zs) -> @zs , mult#3(#true(), @b2, @zs) -> add(@b2, @zs) , sum#1(@s) -> sum#2(#equal(@s, #0()), @s) , sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s) , sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0())) , sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0()))))) , sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0())) , sum#4(#false()) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0())))) , sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0())))) , #pred(#0()) -> #neg(#s(#0())) , #pred(#neg(#s(@x))) -> #neg(#s(#s(@x))) , #pred(#pos(#s(#0()))) -> #0() , #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x)) , #succ(#0()) -> #pos(#s(#0())) , #succ(#neg(#s(#0()))) -> #0() , #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x)) , #succ(#pos(#s(@x))) -> #pos(#s(#s(@x))) , #and(#false(), #false()) -> #false() , #and(#false(), #true()) -> #false() , #and(#true(), #false()) -> #false() , #and(#true(), #true()) -> #true() } StartTerms: basic terms Strategy: innermost No rule is usable, rules are removed from the input problem. We are left with following problem, upon which TcT provides the certificate YES(O(1),O(1)). Rules: Empty Obligation: innermost runtime complexity Answer: YES(O(1),O(1)) Empty rules are trivially bounded Wall-time: 2.061397s CPU-time: 16.423s Wall-time: 27.213875s CPU-time: 235.575s S) We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^1)). Strict DPs: { bitToInt^#(@b) -> c_6(bitToInt'^#(@b, #abs(#pos(#s(#0()))))) , bitToInt'^#(@b, @n) -> c_7(bitToInt'#1^#(@b, @n)) , bitToInt'#1^#(::(@x, @xs), @n) -> c_8(bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0())))))) , compare^#(@b1, @b2) -> c_9(compare#1^#(@b1, @b2)) , compare#1^#(::(@x, @xs), @b2) -> c_10(compare#2^#(@b2, @x, @xs)) , compare#2^#(::(@y, @ys), @x, @xs) -> c_11(compare^#(@xs, @ys)) , leq^#(@b1, @b2) -> c_12(compare^#(@b1, @b2)) , sub^#(@b1, @b2) -> c_18(sub'^#(@b1, @b2, #abs(#0()))) , sub'^#(@b1, @b2, @r) -> c_19(sub'#1^#(@b1, @b2, @r)) , sub'#1^#(::(@x, @xs), @b2, @r) -> c_20(sub'#2^#(@b2, @r, @x, @xs)) , sub'#2^#(::(@y, @ys), @r, @x, @xs) -> c_21(sub'#3^#(diff(@x, @y, @r), @xs, @ys)) , sub'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_22(sub'^#(@xs, @ys, @r')) } Weak DPs: { add^#(@b1, @b2) -> c_1(add'^#(@b1, @b2, #abs(#0()))) , add'^#(@b1, @b2, @r) -> c_2(add'#1^#(@b1, @b2, @r)) , add'#1^#(::(@x, @xs), @b2, @r) -> c_3(add'#2^#(@b2, @r, @x, @xs)) , add'#2^#(::(@y, @ys), @r, @x, @xs) -> c_4(add'#3^#(sum(@x, @y, @r), @xs, @ys)) , add'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_5(add'^#(@xs, @ys, @r')) , mult^#(@b1, @b2) -> c_13(mult#1^#(@b1, @b2)) , mult#1^#(::(@x, @xs), @b2) -> c_14(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x), mult^#(@xs, @b2)) , mult#2^#(@zs, @b2, @x) -> c_15(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs)) , mult#3^#(#true(), @b2, @zs) -> c_16(add^#(@b2, @zs)) , mult3^#(@b1, @b2, @b3) -> c_17(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2)) } Weak Trs: { #abs(#0()) -> #0() , #abs(#neg(@x)) -> #pos(@x) , #abs(#pos(@x)) -> #pos(@x) , #abs(#s(@x)) -> #pos(#s(@x)) , #equal(@x, @y) -> #eq(@x, @y) , #eq(#0(), #0()) -> #true() , #eq(#0(), #neg(@y)) -> #false() , #eq(#0(), #pos(@y)) -> #false() , #eq(#0(), #s(@y)) -> #false() , #eq(#neg(@x), #0()) -> #false() , #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #pos(@y)) -> #false() , #eq(#pos(@x), #0()) -> #false() , #eq(#pos(@x), #neg(@y)) -> #false() , #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y) , #eq(#s(@x), #0()) -> #false() , #eq(#s(@x), #s(@y)) -> #eq(@x, @y) , #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #eq(::(@x_1, @x_2), nil()) -> #false() , #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false() , #eq(nil(), ::(@y_1, @y_2)) -> #false() , #eq(nil(), nil()) -> #true() , #eq(nil(), tuple#2(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), nil()) -> #false() , #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #greater(@x, @y) -> #ckgt(#compare(@x, @y)) , #compare(#0(), #0()) -> #EQ() , #compare(#0(), #neg(@y)) -> #GT() , #compare(#0(), #pos(@y)) -> #LT() , #compare(#0(), #s(@y)) -> #LT() , #compare(#neg(@x), #0()) -> #LT() , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x) , #compare(#neg(@x), #pos(@y)) -> #LT() , #compare(#pos(@x), #0()) -> #GT() , #compare(#pos(@x), #neg(@y)) -> #GT() , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y) , #compare(#s(@x), #0()) -> #GT() , #compare(#s(@x), #s(@y)) -> #compare(@x, @y) , #ckgt(#EQ()) -> #false() , #ckgt(#GT()) -> #true() , #ckgt(#LT()) -> #false() , #less(@x, @y) -> #cklt(#compare(@x, @y)) , #cklt(#EQ()) -> #false() , #cklt(#GT()) -> #false() , #cklt(#LT()) -> #true() , *(@x, @y) -> #mult(@x, @y) , #mult(#0(), #0()) -> #0() , #mult(#0(), #neg(@y)) -> #0() , #mult(#0(), #pos(@y)) -> #0() , #mult(#neg(@x), #0()) -> #0() , #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y)) , #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #0()) -> #0() , #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y)) , +(@x, @y) -> #add(@x, @y) , #add(#0(), @y) -> @y , #add(#neg(#s(#0())), @y) -> #pred(@y) , #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y)) , #add(#pos(#s(#0())), @y) -> #succ(@y) , #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y)) , -(@x, @y) -> #sub(@x, @y) , #sub(@x, #0()) -> @x , #sub(@x, #neg(@y)) -> #add(@x, #pos(@y)) , #sub(@x, #pos(@y)) -> #add(@x, #neg(@y)) , add(@b1, @b2) -> add'(@b1, @b2, #abs(#0())) , add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r) , add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs) , add'#1(nil(), @b2, @r) -> nil() , add'#2(::(@y, @ys), @r, @x, @xs) -> add'#3(sum(@x, @y, @r), @xs, @ys) , add'#2(nil(), @r, @x, @xs) -> nil() , sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r)) , add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r')) , bitToInt(@b) -> bitToInt'(@b, #abs(#pos(#s(#0())))) , bitToInt'(@b, @n) -> bitToInt'#1(@b, @n) , bitToInt'#1(::(@x, @xs), @n) -> +(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))) , bitToInt'#1(nil(), @n) -> #abs(#0()) , compare(@b1, @b2) -> compare#1(@b1, @b2) , compare#1(::(@x, @xs), @b2) -> compare#2(@b2, @x, @xs) , compare#1(nil(), @b2) -> #abs(#0()) , compare#2(::(@y, @ys), @x, @xs) -> compare#3(compare(@xs, @ys), @x, @y) , compare#2(nil(), @x, @xs) -> #abs(#0()) , compare#3(@r, @x, @y) -> compare#4(#equal(@r, #0()), @r, @x, @y) , compare#4(#false(), @r, @x, @y) -> @r , compare#4(#true(), @r, @x, @y) -> compare#5(#less(@x, @y), @x, @y) , compare#5(#false(), @x, @y) -> compare#6(#greater(@x, @y)) , compare#5(#true(), @x, @y) -> -(#0(), #pos(#s(#0()))) , compare#6(#false()) -> #abs(#0()) , compare#6(#true()) -> #abs(#pos(#s(#0()))) , diff(@x, @y, @r) -> tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))), diff#1(#less(-(-(@x, @y), @r), #0()))) , mod(@x, @y) -> -(@x, *(@y, div(@x, @y))) , diff#1(#false()) -> #abs(#0()) , diff#1(#true()) -> #abs(#pos(#s(#0()))) , div(@x, @y) -> #div(@x, @y) , #div(#0(), #0()) -> #divByZero() , #div(#0(), #neg(@y)) -> #0() , #div(#0(), #pos(@y)) -> #0() , #div(#neg(@x), #0()) -> #divByZero() , #div(#neg(@x), #neg(@y)) -> #positive(#natdiv(@x, @y)) , #div(#neg(@x), #pos(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #0()) -> #divByZero() , #div(#pos(@x), #neg(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #pos(@y)) -> #positive(#natdiv(@x, @y)) , leq(@b1, @b2) -> #less(compare(@b1, @b2), #pos(#s(#0()))) , mult(@b1, @b2) -> mult#1(@b1, @b2) , mult#1(::(@x, @xs), @b2) -> mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x) , mult#1(nil(), @b2) -> nil() , mult#2(@zs, @b2, @x) -> mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs) , mult#3(#false(), @b2, @zs) -> @zs , mult#3(#true(), @b2, @zs) -> add(@b2, @zs) , mult3(@b1, @b2, @b3) -> mult(mult(@b1, @b2), @b2) , sub(@b1, @b2) -> sub#1(sub'(@b1, @b2, #abs(#0()))) , sub'(@b1, @b2, @r) -> sub'#1(@b1, @b2, @r) , sub#1(tuple#2(@b, @_@1)) -> @b , sub'#1(::(@x, @xs), @b2, @r) -> sub'#2(@b2, @r, @x, @xs) , sub'#1(nil(), @b2, @r) -> tuple#2(nil(), @r) , sub'#2(::(@y, @ys), @r, @x, @xs) -> sub'#3(diff(@x, @y, @r), @xs, @ys) , sub'#2(nil(), @r, @x, @xs) -> tuple#2(nil(), @r) , sub'#3(tuple#2(@z, @r'), @xs, @ys) -> sub'#4(sub'(@xs, @ys, @r'), @z) , sub'#4(tuple#2(@zs, @s), @z) -> tuple#2(sub'#5(#equal(@s, #pos(#s(#0()))), @z, @zs), @s) , sub'#5(#false(), @z, @zs) -> ::(@z, @zs) , sub'#5(#true(), @z, @zs) -> ::(#abs(#0()), @zs) , sum#1(@s) -> sum#2(#equal(@s, #0()), @s) , sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s) , sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0())) , sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0()))))) , sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0())) , sum#4(#false()) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0())))) , sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0())))) , #pred(#0()) -> #neg(#s(#0())) , #pred(#neg(#s(@x))) -> #neg(#s(#s(@x))) , #pred(#pos(#s(#0()))) -> #0() , #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x)) , #succ(#0()) -> #pos(#s(#0())) , #succ(#neg(#s(#0()))) -> #0() , #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x)) , #succ(#pos(#s(@x))) -> #pos(#s(#s(@x))) , #and(#false(), #false()) -> #false() , #and(#false(), #true()) -> #false() , #and(#true(), #false()) -> #false() , #and(#true(), #true()) -> #true() , #natdiv(#0(), #0()) -> #divByZero() , #natdiv(#0(), #s(@y)) -> #0() , #natdiv(#s(@x), #0()) -> #divByZero() , #natdiv(#s(@x), #s(@y)) -> #natdiv'(#divsub(@x, @y), #s(@y)) , #positive(#0()) -> #0() , #positive(#neg(@x)) -> #neg(@x) , #positive(#pos(@x)) -> #pos(@x) , #positive(#s(@x)) -> #pos(#s(@x)) , #negative(#0()) -> #0() , #negative(#neg(@x)) -> #pos(@x) , #negative(#pos(@x)) -> #neg(@x) , #negative(#s(@x)) -> #neg(#s(@x)) , #divsub(#0(), #0()) -> #0() , #divsub(#0(), #s(@y)) -> #underflow() , #divsub(#s(@x), #0()) -> #s(@x) , #divsub(#s(@x), #s(@y)) -> #divsub(@x, @y) , #natmult(#0(), @y) -> #0() , #natmult(#s(@x), @y) -> #natadd(@y, #natmult(@x, @y)) , #natadd(#0(), @y) -> @y , #natadd(#s(@x), @y) -> #s(#natadd(@x, @y)) , #natdiv'(#0(), @y) -> #s(#0()) , #natdiv'(#s(@x), @y) -> #s(#natdiv(#s(@x), @y)) , #natdiv'(#underflow(), @y) -> #0() , #natsub(@x, #0()) -> @x , #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^1)) The following weak DPs constitute a sub-graph of the DG that is closed under successors. The DPs are removed. { add^#(@b1, @b2) -> c_1(add'^#(@b1, @b2, #abs(#0()))) , add'^#(@b1, @b2, @r) -> c_2(add'#1^#(@b1, @b2, @r)) , add'#1^#(::(@x, @xs), @b2, @r) -> c_3(add'#2^#(@b2, @r, @x, @xs)) , add'#2^#(::(@y, @ys), @r, @x, @xs) -> c_4(add'#3^#(sum(@x, @y, @r), @xs, @ys)) , add'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_5(add'^#(@xs, @ys, @r')) , mult^#(@b1, @b2) -> c_13(mult#1^#(@b1, @b2)) , mult#1^#(::(@x, @xs), @b2) -> c_14(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x), mult^#(@xs, @b2)) , mult#2^#(@zs, @b2, @x) -> c_15(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs)) , mult#3^#(#true(), @b2, @zs) -> c_16(add^#(@b2, @zs)) , mult3^#(@b1, @b2, @b3) -> c_17(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2)) } We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^1)). Strict DPs: { bitToInt^#(@b) -> c_6(bitToInt'^#(@b, #abs(#pos(#s(#0()))))) , bitToInt'^#(@b, @n) -> c_7(bitToInt'#1^#(@b, @n)) , bitToInt'#1^#(::(@x, @xs), @n) -> c_8(bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0())))))) , compare^#(@b1, @b2) -> c_9(compare#1^#(@b1, @b2)) , compare#1^#(::(@x, @xs), @b2) -> c_10(compare#2^#(@b2, @x, @xs)) , compare#2^#(::(@y, @ys), @x, @xs) -> c_11(compare^#(@xs, @ys)) , leq^#(@b1, @b2) -> c_12(compare^#(@b1, @b2)) , sub^#(@b1, @b2) -> c_18(sub'^#(@b1, @b2, #abs(#0()))) , sub'^#(@b1, @b2, @r) -> c_19(sub'#1^#(@b1, @b2, @r)) , sub'#1^#(::(@x, @xs), @b2, @r) -> c_20(sub'#2^#(@b2, @r, @x, @xs)) , sub'#2^#(::(@y, @ys), @r, @x, @xs) -> c_21(sub'#3^#(diff(@x, @y, @r), @xs, @ys)) , sub'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_22(sub'^#(@xs, @ys, @r')) } Weak Trs: { #abs(#0()) -> #0() , #abs(#neg(@x)) -> #pos(@x) , #abs(#pos(@x)) -> #pos(@x) , #abs(#s(@x)) -> #pos(#s(@x)) , #equal(@x, @y) -> #eq(@x, @y) , #eq(#0(), #0()) -> #true() , #eq(#0(), #neg(@y)) -> #false() , #eq(#0(), #pos(@y)) -> #false() , #eq(#0(), #s(@y)) -> #false() , #eq(#neg(@x), #0()) -> #false() , #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #pos(@y)) -> #false() , #eq(#pos(@x), #0()) -> #false() , #eq(#pos(@x), #neg(@y)) -> #false() , #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y) , #eq(#s(@x), #0()) -> #false() , #eq(#s(@x), #s(@y)) -> #eq(@x, @y) , #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #eq(::(@x_1, @x_2), nil()) -> #false() , #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false() , #eq(nil(), ::(@y_1, @y_2)) -> #false() , #eq(nil(), nil()) -> #true() , #eq(nil(), tuple#2(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), nil()) -> #false() , #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #greater(@x, @y) -> #ckgt(#compare(@x, @y)) , #compare(#0(), #0()) -> #EQ() , #compare(#0(), #neg(@y)) -> #GT() , #compare(#0(), #pos(@y)) -> #LT() , #compare(#0(), #s(@y)) -> #LT() , #compare(#neg(@x), #0()) -> #LT() , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x) , #compare(#neg(@x), #pos(@y)) -> #LT() , #compare(#pos(@x), #0()) -> #GT() , #compare(#pos(@x), #neg(@y)) -> #GT() , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y) , #compare(#s(@x), #0()) -> #GT() , #compare(#s(@x), #s(@y)) -> #compare(@x, @y) , #ckgt(#EQ()) -> #false() , #ckgt(#GT()) -> #true() , #ckgt(#LT()) -> #false() , #less(@x, @y) -> #cklt(#compare(@x, @y)) , #cklt(#EQ()) -> #false() , #cklt(#GT()) -> #false() , #cklt(#LT()) -> #true() , *(@x, @y) -> #mult(@x, @y) , #mult(#0(), #0()) -> #0() , #mult(#0(), #neg(@y)) -> #0() , #mult(#0(), #pos(@y)) -> #0() , #mult(#neg(@x), #0()) -> #0() , #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y)) , #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #0()) -> #0() , #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y)) , +(@x, @y) -> #add(@x, @y) , #add(#0(), @y) -> @y , #add(#neg(#s(#0())), @y) -> #pred(@y) , #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y)) , #add(#pos(#s(#0())), @y) -> #succ(@y) , #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y)) , -(@x, @y) -> #sub(@x, @y) , #sub(@x, #0()) -> @x , #sub(@x, #neg(@y)) -> #add(@x, #pos(@y)) , #sub(@x, #pos(@y)) -> #add(@x, #neg(@y)) , add(@b1, @b2) -> add'(@b1, @b2, #abs(#0())) , add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r) , add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs) , add'#1(nil(), @b2, @r) -> nil() , add'#2(::(@y, @ys), @r, @x, @xs) -> add'#3(sum(@x, @y, @r), @xs, @ys) , add'#2(nil(), @r, @x, @xs) -> nil() , sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r)) , add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r')) , bitToInt(@b) -> bitToInt'(@b, #abs(#pos(#s(#0())))) , bitToInt'(@b, @n) -> bitToInt'#1(@b, @n) , bitToInt'#1(::(@x, @xs), @n) -> +(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))) , bitToInt'#1(nil(), @n) -> #abs(#0()) , compare(@b1, @b2) -> compare#1(@b1, @b2) , compare#1(::(@x, @xs), @b2) -> compare#2(@b2, @x, @xs) , compare#1(nil(), @b2) -> #abs(#0()) , compare#2(::(@y, @ys), @x, @xs) -> compare#3(compare(@xs, @ys), @x, @y) , compare#2(nil(), @x, @xs) -> #abs(#0()) , compare#3(@r, @x, @y) -> compare#4(#equal(@r, #0()), @r, @x, @y) , compare#4(#false(), @r, @x, @y) -> @r , compare#4(#true(), @r, @x, @y) -> compare#5(#less(@x, @y), @x, @y) , compare#5(#false(), @x, @y) -> compare#6(#greater(@x, @y)) , compare#5(#true(), @x, @y) -> -(#0(), #pos(#s(#0()))) , compare#6(#false()) -> #abs(#0()) , compare#6(#true()) -> #abs(#pos(#s(#0()))) , diff(@x, @y, @r) -> tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))), diff#1(#less(-(-(@x, @y), @r), #0()))) , mod(@x, @y) -> -(@x, *(@y, div(@x, @y))) , diff#1(#false()) -> #abs(#0()) , diff#1(#true()) -> #abs(#pos(#s(#0()))) , div(@x, @y) -> #div(@x, @y) , #div(#0(), #0()) -> #divByZero() , #div(#0(), #neg(@y)) -> #0() , #div(#0(), #pos(@y)) -> #0() , #div(#neg(@x), #0()) -> #divByZero() , #div(#neg(@x), #neg(@y)) -> #positive(#natdiv(@x, @y)) , #div(#neg(@x), #pos(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #0()) -> #divByZero() , #div(#pos(@x), #neg(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #pos(@y)) -> #positive(#natdiv(@x, @y)) , leq(@b1, @b2) -> #less(compare(@b1, @b2), #pos(#s(#0()))) , mult(@b1, @b2) -> mult#1(@b1, @b2) , mult#1(::(@x, @xs), @b2) -> mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x) , mult#1(nil(), @b2) -> nil() , mult#2(@zs, @b2, @x) -> mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs) , mult#3(#false(), @b2, @zs) -> @zs , mult#3(#true(), @b2, @zs) -> add(@b2, @zs) , mult3(@b1, @b2, @b3) -> mult(mult(@b1, @b2), @b2) , sub(@b1, @b2) -> sub#1(sub'(@b1, @b2, #abs(#0()))) , sub'(@b1, @b2, @r) -> sub'#1(@b1, @b2, @r) , sub#1(tuple#2(@b, @_@1)) -> @b , sub'#1(::(@x, @xs), @b2, @r) -> sub'#2(@b2, @r, @x, @xs) , sub'#1(nil(), @b2, @r) -> tuple#2(nil(), @r) , sub'#2(::(@y, @ys), @r, @x, @xs) -> sub'#3(diff(@x, @y, @r), @xs, @ys) , sub'#2(nil(), @r, @x, @xs) -> tuple#2(nil(), @r) , sub'#3(tuple#2(@z, @r'), @xs, @ys) -> sub'#4(sub'(@xs, @ys, @r'), @z) , sub'#4(tuple#2(@zs, @s), @z) -> tuple#2(sub'#5(#equal(@s, #pos(#s(#0()))), @z, @zs), @s) , sub'#5(#false(), @z, @zs) -> ::(@z, @zs) , sub'#5(#true(), @z, @zs) -> ::(#abs(#0()), @zs) , sum#1(@s) -> sum#2(#equal(@s, #0()), @s) , sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s) , sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0())) , sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0()))))) , sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0())) , sum#4(#false()) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0())))) , sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0())))) , #pred(#0()) -> #neg(#s(#0())) , #pred(#neg(#s(@x))) -> #neg(#s(#s(@x))) , #pred(#pos(#s(#0()))) -> #0() , #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x)) , #succ(#0()) -> #pos(#s(#0())) , #succ(#neg(#s(#0()))) -> #0() , #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x)) , #succ(#pos(#s(@x))) -> #pos(#s(#s(@x))) , #and(#false(), #false()) -> #false() , #and(#false(), #true()) -> #false() , #and(#true(), #false()) -> #false() , #and(#true(), #true()) -> #true() , #natdiv(#0(), #0()) -> #divByZero() , #natdiv(#0(), #s(@y)) -> #0() , #natdiv(#s(@x), #0()) -> #divByZero() , #natdiv(#s(@x), #s(@y)) -> #natdiv'(#divsub(@x, @y), #s(@y)) , #positive(#0()) -> #0() , #positive(#neg(@x)) -> #neg(@x) , #positive(#pos(@x)) -> #pos(@x) , #positive(#s(@x)) -> #pos(#s(@x)) , #negative(#0()) -> #0() , #negative(#neg(@x)) -> #pos(@x) , #negative(#pos(@x)) -> #neg(@x) , #negative(#s(@x)) -> #neg(#s(@x)) , #divsub(#0(), #0()) -> #0() , #divsub(#0(), #s(@y)) -> #underflow() , #divsub(#s(@x), #0()) -> #s(@x) , #divsub(#s(@x), #s(@y)) -> #divsub(@x, @y) , #natmult(#0(), @y) -> #0() , #natmult(#s(@x), @y) -> #natadd(@y, #natmult(@x, @y)) , #natadd(#0(), @y) -> @y , #natadd(#s(@x), @y) -> #s(#natadd(@x, @y)) , #natdiv'(#0(), @y) -> #s(#0()) , #natdiv'(#s(@x), @y) -> #s(#natdiv(#s(@x), @y)) , #natdiv'(#underflow(), @y) -> #0() , #natsub(@x, #0()) -> @x , #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^1)) We analyse the complexity of following sub-problems (R) and (S). Problem (S) is obtained from the input problem by shifting strict rules from (R) into the weak component: Problem (R): ------------ Strict DPs: { bitToInt^#(@b) -> c_6(bitToInt'^#(@b, #abs(#pos(#s(#0()))))) , bitToInt'^#(@b, @n) -> c_7(bitToInt'#1^#(@b, @n)) , bitToInt'#1^#(::(@x, @xs), @n) -> c_8(bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0())))))) } Weak DPs: { compare^#(@b1, @b2) -> c_9(compare#1^#(@b1, @b2)) , compare#1^#(::(@x, @xs), @b2) -> c_10(compare#2^#(@b2, @x, @xs)) , compare#2^#(::(@y, @ys), @x, @xs) -> c_11(compare^#(@xs, @ys)) , leq^#(@b1, @b2) -> c_12(compare^#(@b1, @b2)) , sub^#(@b1, @b2) -> c_18(sub'^#(@b1, @b2, #abs(#0()))) , sub'^#(@b1, @b2, @r) -> c_19(sub'#1^#(@b1, @b2, @r)) , sub'#1^#(::(@x, @xs), @b2, @r) -> c_20(sub'#2^#(@b2, @r, @x, @xs)) , sub'#2^#(::(@y, @ys), @r, @x, @xs) -> c_21(sub'#3^#(diff(@x, @y, @r), @xs, @ys)) , sub'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_22(sub'^#(@xs, @ys, @r')) } Weak Trs: { #abs(#0()) -> #0() , #abs(#neg(@x)) -> #pos(@x) , #abs(#pos(@x)) -> #pos(@x) , #abs(#s(@x)) -> #pos(#s(@x)) , #equal(@x, @y) -> #eq(@x, @y) , #eq(#0(), #0()) -> #true() , #eq(#0(), #neg(@y)) -> #false() , #eq(#0(), #pos(@y)) -> #false() , #eq(#0(), #s(@y)) -> #false() , #eq(#neg(@x), #0()) -> #false() , #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #pos(@y)) -> #false() , #eq(#pos(@x), #0()) -> #false() , #eq(#pos(@x), #neg(@y)) -> #false() , #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y) , #eq(#s(@x), #0()) -> #false() , #eq(#s(@x), #s(@y)) -> #eq(@x, @y) , #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #eq(::(@x_1, @x_2), nil()) -> #false() , #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false() , #eq(nil(), ::(@y_1, @y_2)) -> #false() , #eq(nil(), nil()) -> #true() , #eq(nil(), tuple#2(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), nil()) -> #false() , #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #greater(@x, @y) -> #ckgt(#compare(@x, @y)) , #compare(#0(), #0()) -> #EQ() , #compare(#0(), #neg(@y)) -> #GT() , #compare(#0(), #pos(@y)) -> #LT() , #compare(#0(), #s(@y)) -> #LT() , #compare(#neg(@x), #0()) -> #LT() , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x) , #compare(#neg(@x), #pos(@y)) -> #LT() , #compare(#pos(@x), #0()) -> #GT() , #compare(#pos(@x), #neg(@y)) -> #GT() , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y) , #compare(#s(@x), #0()) -> #GT() , #compare(#s(@x), #s(@y)) -> #compare(@x, @y) , #ckgt(#EQ()) -> #false() , #ckgt(#GT()) -> #true() , #ckgt(#LT()) -> #false() , #less(@x, @y) -> #cklt(#compare(@x, @y)) , #cklt(#EQ()) -> #false() , #cklt(#GT()) -> #false() , #cklt(#LT()) -> #true() , *(@x, @y) -> #mult(@x, @y) , #mult(#0(), #0()) -> #0() , #mult(#0(), #neg(@y)) -> #0() , #mult(#0(), #pos(@y)) -> #0() , #mult(#neg(@x), #0()) -> #0() , #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y)) , #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #0()) -> #0() , #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y)) , +(@x, @y) -> #add(@x, @y) , #add(#0(), @y) -> @y , #add(#neg(#s(#0())), @y) -> #pred(@y) , #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y)) , #add(#pos(#s(#0())), @y) -> #succ(@y) , #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y)) , -(@x, @y) -> #sub(@x, @y) , #sub(@x, #0()) -> @x , #sub(@x, #neg(@y)) -> #add(@x, #pos(@y)) , #sub(@x, #pos(@y)) -> #add(@x, #neg(@y)) , add(@b1, @b2) -> add'(@b1, @b2, #abs(#0())) , add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r) , add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs) , add'#1(nil(), @b2, @r) -> nil() , add'#2(::(@y, @ys), @r, @x, @xs) -> add'#3(sum(@x, @y, @r), @xs, @ys) , add'#2(nil(), @r, @x, @xs) -> nil() , sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r)) , add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r')) , bitToInt(@b) -> bitToInt'(@b, #abs(#pos(#s(#0())))) , bitToInt'(@b, @n) -> bitToInt'#1(@b, @n) , bitToInt'#1(::(@x, @xs), @n) -> +(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))) , bitToInt'#1(nil(), @n) -> #abs(#0()) , compare(@b1, @b2) -> compare#1(@b1, @b2) , compare#1(::(@x, @xs), @b2) -> compare#2(@b2, @x, @xs) , compare#1(nil(), @b2) -> #abs(#0()) , compare#2(::(@y, @ys), @x, @xs) -> compare#3(compare(@xs, @ys), @x, @y) , compare#2(nil(), @x, @xs) -> #abs(#0()) , compare#3(@r, @x, @y) -> compare#4(#equal(@r, #0()), @r, @x, @y) , compare#4(#false(), @r, @x, @y) -> @r , compare#4(#true(), @r, @x, @y) -> compare#5(#less(@x, @y), @x, @y) , compare#5(#false(), @x, @y) -> compare#6(#greater(@x, @y)) , compare#5(#true(), @x, @y) -> -(#0(), #pos(#s(#0()))) , compare#6(#false()) -> #abs(#0()) , compare#6(#true()) -> #abs(#pos(#s(#0()))) , diff(@x, @y, @r) -> tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))), diff#1(#less(-(-(@x, @y), @r), #0()))) , mod(@x, @y) -> -(@x, *(@y, div(@x, @y))) , diff#1(#false()) -> #abs(#0()) , diff#1(#true()) -> #abs(#pos(#s(#0()))) , div(@x, @y) -> #div(@x, @y) , #div(#0(), #0()) -> #divByZero() , #div(#0(), #neg(@y)) -> #0() , #div(#0(), #pos(@y)) -> #0() , #div(#neg(@x), #0()) -> #divByZero() , #div(#neg(@x), #neg(@y)) -> #positive(#natdiv(@x, @y)) , #div(#neg(@x), #pos(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #0()) -> #divByZero() , #div(#pos(@x), #neg(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #pos(@y)) -> #positive(#natdiv(@x, @y)) , leq(@b1, @b2) -> #less(compare(@b1, @b2), #pos(#s(#0()))) , mult(@b1, @b2) -> mult#1(@b1, @b2) , mult#1(::(@x, @xs), @b2) -> mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x) , mult#1(nil(), @b2) -> nil() , mult#2(@zs, @b2, @x) -> mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs) , mult#3(#false(), @b2, @zs) -> @zs , mult#3(#true(), @b2, @zs) -> add(@b2, @zs) , mult3(@b1, @b2, @b3) -> mult(mult(@b1, @b2), @b2) , sub(@b1, @b2) -> sub#1(sub'(@b1, @b2, #abs(#0()))) , sub'(@b1, @b2, @r) -> sub'#1(@b1, @b2, @r) , sub#1(tuple#2(@b, @_@1)) -> @b , sub'#1(::(@x, @xs), @b2, @r) -> sub'#2(@b2, @r, @x, @xs) , sub'#1(nil(), @b2, @r) -> tuple#2(nil(), @r) , sub'#2(::(@y, @ys), @r, @x, @xs) -> sub'#3(diff(@x, @y, @r), @xs, @ys) , sub'#2(nil(), @r, @x, @xs) -> tuple#2(nil(), @r) , sub'#3(tuple#2(@z, @r'), @xs, @ys) -> sub'#4(sub'(@xs, @ys, @r'), @z) , sub'#4(tuple#2(@zs, @s), @z) -> tuple#2(sub'#5(#equal(@s, #pos(#s(#0()))), @z, @zs), @s) , sub'#5(#false(), @z, @zs) -> ::(@z, @zs) , sub'#5(#true(), @z, @zs) -> ::(#abs(#0()), @zs) , sum#1(@s) -> sum#2(#equal(@s, #0()), @s) , sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s) , sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0())) , sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0()))))) , sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0())) , sum#4(#false()) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0())))) , sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0())))) , #pred(#0()) -> #neg(#s(#0())) , #pred(#neg(#s(@x))) -> #neg(#s(#s(@x))) , #pred(#pos(#s(#0()))) -> #0() , #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x)) , #succ(#0()) -> #pos(#s(#0())) , #succ(#neg(#s(#0()))) -> #0() , #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x)) , #succ(#pos(#s(@x))) -> #pos(#s(#s(@x))) , #and(#false(), #false()) -> #false() , #and(#false(), #true()) -> #false() , #and(#true(), #false()) -> #false() , #and(#true(), #true()) -> #true() , #natdiv(#0(), #0()) -> #divByZero() , #natdiv(#0(), #s(@y)) -> #0() , #natdiv(#s(@x), #0()) -> #divByZero() , #natdiv(#s(@x), #s(@y)) -> #natdiv'(#divsub(@x, @y), #s(@y)) , #positive(#0()) -> #0() , #positive(#neg(@x)) -> #neg(@x) , #positive(#pos(@x)) -> #pos(@x) , #positive(#s(@x)) -> #pos(#s(@x)) , #negative(#0()) -> #0() , #negative(#neg(@x)) -> #pos(@x) , #negative(#pos(@x)) -> #neg(@x) , #negative(#s(@x)) -> #neg(#s(@x)) , #divsub(#0(), #0()) -> #0() , #divsub(#0(), #s(@y)) -> #underflow() , #divsub(#s(@x), #0()) -> #s(@x) , #divsub(#s(@x), #s(@y)) -> #divsub(@x, @y) , #natmult(#0(), @y) -> #0() , #natmult(#s(@x), @y) -> #natadd(@y, #natmult(@x, @y)) , #natadd(#0(), @y) -> @y , #natadd(#s(@x), @y) -> #s(#natadd(@x, @y)) , #natdiv'(#0(), @y) -> #s(#0()) , #natdiv'(#s(@x), @y) -> #s(#natdiv(#s(@x), @y)) , #natdiv'(#underflow(), @y) -> #0() , #natsub(@x, #0()) -> @x , #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) } StartTerms: basic terms Strategy: innermost Problem (S): ------------ Strict DPs: { compare^#(@b1, @b2) -> c_9(compare#1^#(@b1, @b2)) , compare#1^#(::(@x, @xs), @b2) -> c_10(compare#2^#(@b2, @x, @xs)) , compare#2^#(::(@y, @ys), @x, @xs) -> c_11(compare^#(@xs, @ys)) , leq^#(@b1, @b2) -> c_12(compare^#(@b1, @b2)) , sub^#(@b1, @b2) -> c_18(sub'^#(@b1, @b2, #abs(#0()))) , sub'^#(@b1, @b2, @r) -> c_19(sub'#1^#(@b1, @b2, @r)) , sub'#1^#(::(@x, @xs), @b2, @r) -> c_20(sub'#2^#(@b2, @r, @x, @xs)) , sub'#2^#(::(@y, @ys), @r, @x, @xs) -> c_21(sub'#3^#(diff(@x, @y, @r), @xs, @ys)) , sub'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_22(sub'^#(@xs, @ys, @r')) } Weak DPs: { bitToInt^#(@b) -> c_6(bitToInt'^#(@b, #abs(#pos(#s(#0()))))) , bitToInt'^#(@b, @n) -> c_7(bitToInt'#1^#(@b, @n)) , bitToInt'#1^#(::(@x, @xs), @n) -> c_8(bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0())))))) } Weak Trs: { #abs(#0()) -> #0() , #abs(#neg(@x)) -> #pos(@x) , #abs(#pos(@x)) -> #pos(@x) , #abs(#s(@x)) -> #pos(#s(@x)) , #equal(@x, @y) -> #eq(@x, @y) , #eq(#0(), #0()) -> #true() , #eq(#0(), #neg(@y)) -> #false() , #eq(#0(), #pos(@y)) -> #false() , #eq(#0(), #s(@y)) -> #false() , #eq(#neg(@x), #0()) -> #false() , #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #pos(@y)) -> #false() , #eq(#pos(@x), #0()) -> #false() , #eq(#pos(@x), #neg(@y)) -> #false() , #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y) , #eq(#s(@x), #0()) -> #false() , #eq(#s(@x), #s(@y)) -> #eq(@x, @y) , #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #eq(::(@x_1, @x_2), nil()) -> #false() , #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false() , #eq(nil(), ::(@y_1, @y_2)) -> #false() , #eq(nil(), nil()) -> #true() , #eq(nil(), tuple#2(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), nil()) -> #false() , #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #greater(@x, @y) -> #ckgt(#compare(@x, @y)) , #compare(#0(), #0()) -> #EQ() , #compare(#0(), #neg(@y)) -> #GT() , #compare(#0(), #pos(@y)) -> #LT() , #compare(#0(), #s(@y)) -> #LT() , #compare(#neg(@x), #0()) -> #LT() , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x) , #compare(#neg(@x), #pos(@y)) -> #LT() , #compare(#pos(@x), #0()) -> #GT() , #compare(#pos(@x), #neg(@y)) -> #GT() , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y) , #compare(#s(@x), #0()) -> #GT() , #compare(#s(@x), #s(@y)) -> #compare(@x, @y) , #ckgt(#EQ()) -> #false() , #ckgt(#GT()) -> #true() , #ckgt(#LT()) -> #false() , #less(@x, @y) -> #cklt(#compare(@x, @y)) , #cklt(#EQ()) -> #false() , #cklt(#GT()) -> #false() , #cklt(#LT()) -> #true() , *(@x, @y) -> #mult(@x, @y) , #mult(#0(), #0()) -> #0() , #mult(#0(), #neg(@y)) -> #0() , #mult(#0(), #pos(@y)) -> #0() , #mult(#neg(@x), #0()) -> #0() , #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y)) , #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #0()) -> #0() , #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y)) , +(@x, @y) -> #add(@x, @y) , #add(#0(), @y) -> @y , #add(#neg(#s(#0())), @y) -> #pred(@y) , #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y)) , #add(#pos(#s(#0())), @y) -> #succ(@y) , #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y)) , -(@x, @y) -> #sub(@x, @y) , #sub(@x, #0()) -> @x , #sub(@x, #neg(@y)) -> #add(@x, #pos(@y)) , #sub(@x, #pos(@y)) -> #add(@x, #neg(@y)) , add(@b1, @b2) -> add'(@b1, @b2, #abs(#0())) , add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r) , add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs) , add'#1(nil(), @b2, @r) -> nil() , add'#2(::(@y, @ys), @r, @x, @xs) -> add'#3(sum(@x, @y, @r), @xs, @ys) , add'#2(nil(), @r, @x, @xs) -> nil() , sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r)) , add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r')) , bitToInt(@b) -> bitToInt'(@b, #abs(#pos(#s(#0())))) , bitToInt'(@b, @n) -> bitToInt'#1(@b, @n) , bitToInt'#1(::(@x, @xs), @n) -> +(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))) , bitToInt'#1(nil(), @n) -> #abs(#0()) , compare(@b1, @b2) -> compare#1(@b1, @b2) , compare#1(::(@x, @xs), @b2) -> compare#2(@b2, @x, @xs) , compare#1(nil(), @b2) -> #abs(#0()) , compare#2(::(@y, @ys), @x, @xs) -> compare#3(compare(@xs, @ys), @x, @y) , compare#2(nil(), @x, @xs) -> #abs(#0()) , compare#3(@r, @x, @y) -> compare#4(#equal(@r, #0()), @r, @x, @y) , compare#4(#false(), @r, @x, @y) -> @r , compare#4(#true(), @r, @x, @y) -> compare#5(#less(@x, @y), @x, @y) , compare#5(#false(), @x, @y) -> compare#6(#greater(@x, @y)) , compare#5(#true(), @x, @y) -> -(#0(), #pos(#s(#0()))) , compare#6(#false()) -> #abs(#0()) , compare#6(#true()) -> #abs(#pos(#s(#0()))) , diff(@x, @y, @r) -> tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))), diff#1(#less(-(-(@x, @y), @r), #0()))) , mod(@x, @y) -> -(@x, *(@y, div(@x, @y))) , diff#1(#false()) -> #abs(#0()) , diff#1(#true()) -> #abs(#pos(#s(#0()))) , div(@x, @y) -> #div(@x, @y) , #div(#0(), #0()) -> #divByZero() , #div(#0(), #neg(@y)) -> #0() , #div(#0(), #pos(@y)) -> #0() , #div(#neg(@x), #0()) -> #divByZero() , #div(#neg(@x), #neg(@y)) -> #positive(#natdiv(@x, @y)) , #div(#neg(@x), #pos(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #0()) -> #divByZero() , #div(#pos(@x), #neg(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #pos(@y)) -> #positive(#natdiv(@x, @y)) , leq(@b1, @b2) -> #less(compare(@b1, @b2), #pos(#s(#0()))) , mult(@b1, @b2) -> mult#1(@b1, @b2) , mult#1(::(@x, @xs), @b2) -> mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x) , mult#1(nil(), @b2) -> nil() , mult#2(@zs, @b2, @x) -> mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs) , mult#3(#false(), @b2, @zs) -> @zs , mult#3(#true(), @b2, @zs) -> add(@b2, @zs) , mult3(@b1, @b2, @b3) -> mult(mult(@b1, @b2), @b2) , sub(@b1, @b2) -> sub#1(sub'(@b1, @b2, #abs(#0()))) , sub'(@b1, @b2, @r) -> sub'#1(@b1, @b2, @r) , sub#1(tuple#2(@b, @_@1)) -> @b , sub'#1(::(@x, @xs), @b2, @r) -> sub'#2(@b2, @r, @x, @xs) , sub'#1(nil(), @b2, @r) -> tuple#2(nil(), @r) , sub'#2(::(@y, @ys), @r, @x, @xs) -> sub'#3(diff(@x, @y, @r), @xs, @ys) , sub'#2(nil(), @r, @x, @xs) -> tuple#2(nil(), @r) , sub'#3(tuple#2(@z, @r'), @xs, @ys) -> sub'#4(sub'(@xs, @ys, @r'), @z) , sub'#4(tuple#2(@zs, @s), @z) -> tuple#2(sub'#5(#equal(@s, #pos(#s(#0()))), @z, @zs), @s) , sub'#5(#false(), @z, @zs) -> ::(@z, @zs) , sub'#5(#true(), @z, @zs) -> ::(#abs(#0()), @zs) , sum#1(@s) -> sum#2(#equal(@s, #0()), @s) , sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s) , sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0())) , sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0()))))) , sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0())) , sum#4(#false()) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0())))) , sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0())))) , #pred(#0()) -> #neg(#s(#0())) , #pred(#neg(#s(@x))) -> #neg(#s(#s(@x))) , #pred(#pos(#s(#0()))) -> #0() , #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x)) , #succ(#0()) -> #pos(#s(#0())) , #succ(#neg(#s(#0()))) -> #0() , #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x)) , #succ(#pos(#s(@x))) -> #pos(#s(#s(@x))) , #and(#false(), #false()) -> #false() , #and(#false(), #true()) -> #false() , #and(#true(), #false()) -> #false() , #and(#true(), #true()) -> #true() , #natdiv(#0(), #0()) -> #divByZero() , #natdiv(#0(), #s(@y)) -> #0() , #natdiv(#s(@x), #0()) -> #divByZero() , #natdiv(#s(@x), #s(@y)) -> #natdiv'(#divsub(@x, @y), #s(@y)) , #positive(#0()) -> #0() , #positive(#neg(@x)) -> #neg(@x) , #positive(#pos(@x)) -> #pos(@x) , #positive(#s(@x)) -> #pos(#s(@x)) , #negative(#0()) -> #0() , #negative(#neg(@x)) -> #pos(@x) , #negative(#pos(@x)) -> #neg(@x) , #negative(#s(@x)) -> #neg(#s(@x)) , #divsub(#0(), #0()) -> #0() , #divsub(#0(), #s(@y)) -> #underflow() , #divsub(#s(@x), #0()) -> #s(@x) , #divsub(#s(@x), #s(@y)) -> #divsub(@x, @y) , #natmult(#0(), @y) -> #0() , #natmult(#s(@x), @y) -> #natadd(@y, #natmult(@x, @y)) , #natadd(#0(), @y) -> @y , #natadd(#s(@x), @y) -> #s(#natadd(@x, @y)) , #natdiv'(#0(), @y) -> #s(#0()) , #natdiv'(#s(@x), @y) -> #s(#natdiv(#s(@x), @y)) , #natdiv'(#underflow(), @y) -> #0() , #natsub(@x, #0()) -> @x , #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) } StartTerms: basic terms Strategy: innermost Overall, the transformation results in the following sub-problem(s): Generated new problems: ----------------------- R) Strict DPs: { bitToInt^#(@b) -> c_6(bitToInt'^#(@b, #abs(#pos(#s(#0()))))) , bitToInt'^#(@b, @n) -> c_7(bitToInt'#1^#(@b, @n)) , bitToInt'#1^#(::(@x, @xs), @n) -> c_8(bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0())))))) } Weak DPs: { compare^#(@b1, @b2) -> c_9(compare#1^#(@b1, @b2)) , compare#1^#(::(@x, @xs), @b2) -> c_10(compare#2^#(@b2, @x, @xs)) , compare#2^#(::(@y, @ys), @x, @xs) -> c_11(compare^#(@xs, @ys)) , leq^#(@b1, @b2) -> c_12(compare^#(@b1, @b2)) , sub^#(@b1, @b2) -> c_18(sub'^#(@b1, @b2, #abs(#0()))) , sub'^#(@b1, @b2, @r) -> c_19(sub'#1^#(@b1, @b2, @r)) , sub'#1^#(::(@x, @xs), @b2, @r) -> c_20(sub'#2^#(@b2, @r, @x, @xs)) , sub'#2^#(::(@y, @ys), @r, @x, @xs) -> c_21(sub'#3^#(diff(@x, @y, @r), @xs, @ys)) , sub'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_22(sub'^#(@xs, @ys, @r')) } Weak Trs: { #abs(#0()) -> #0() , #abs(#neg(@x)) -> #pos(@x) , #abs(#pos(@x)) -> #pos(@x) , #abs(#s(@x)) -> #pos(#s(@x)) , #equal(@x, @y) -> #eq(@x, @y) , #eq(#0(), #0()) -> #true() , #eq(#0(), #neg(@y)) -> #false() , #eq(#0(), #pos(@y)) -> #false() , #eq(#0(), #s(@y)) -> #false() , #eq(#neg(@x), #0()) -> #false() , #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #pos(@y)) -> #false() , #eq(#pos(@x), #0()) -> #false() , #eq(#pos(@x), #neg(@y)) -> #false() , #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y) , #eq(#s(@x), #0()) -> #false() , #eq(#s(@x), #s(@y)) -> #eq(@x, @y) , #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #eq(::(@x_1, @x_2), nil()) -> #false() , #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false() , #eq(nil(), ::(@y_1, @y_2)) -> #false() , #eq(nil(), nil()) -> #true() , #eq(nil(), tuple#2(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), nil()) -> #false() , #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #greater(@x, @y) -> #ckgt(#compare(@x, @y)) , #compare(#0(), #0()) -> #EQ() , #compare(#0(), #neg(@y)) -> #GT() , #compare(#0(), #pos(@y)) -> #LT() , #compare(#0(), #s(@y)) -> #LT() , #compare(#neg(@x), #0()) -> #LT() , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x) , #compare(#neg(@x), #pos(@y)) -> #LT() , #compare(#pos(@x), #0()) -> #GT() , #compare(#pos(@x), #neg(@y)) -> #GT() , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y) , #compare(#s(@x), #0()) -> #GT() , #compare(#s(@x), #s(@y)) -> #compare(@x, @y) , #ckgt(#EQ()) -> #false() , #ckgt(#GT()) -> #true() , #ckgt(#LT()) -> #false() , #less(@x, @y) -> #cklt(#compare(@x, @y)) , #cklt(#EQ()) -> #false() , #cklt(#GT()) -> #false() , #cklt(#LT()) -> #true() , *(@x, @y) -> #mult(@x, @y) , #mult(#0(), #0()) -> #0() , #mult(#0(), #neg(@y)) -> #0() , #mult(#0(), #pos(@y)) -> #0() , #mult(#neg(@x), #0()) -> #0() , #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y)) , #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #0()) -> #0() , #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y)) , +(@x, @y) -> #add(@x, @y) , #add(#0(), @y) -> @y , #add(#neg(#s(#0())), @y) -> #pred(@y) , #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y)) , #add(#pos(#s(#0())), @y) -> #succ(@y) , #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y)) , -(@x, @y) -> #sub(@x, @y) , #sub(@x, #0()) -> @x , #sub(@x, #neg(@y)) -> #add(@x, #pos(@y)) , #sub(@x, #pos(@y)) -> #add(@x, #neg(@y)) , add(@b1, @b2) -> add'(@b1, @b2, #abs(#0())) , add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r) , add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs) , add'#1(nil(), @b2, @r) -> nil() , add'#2(::(@y, @ys), @r, @x, @xs) -> add'#3(sum(@x, @y, @r), @xs, @ys) , add'#2(nil(), @r, @x, @xs) -> nil() , sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r)) , add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r')) , bitToInt(@b) -> bitToInt'(@b, #abs(#pos(#s(#0())))) , bitToInt'(@b, @n) -> bitToInt'#1(@b, @n) , bitToInt'#1(::(@x, @xs), @n) -> +(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))) , bitToInt'#1(nil(), @n) -> #abs(#0()) , compare(@b1, @b2) -> compare#1(@b1, @b2) , compare#1(::(@x, @xs), @b2) -> compare#2(@b2, @x, @xs) , compare#1(nil(), @b2) -> #abs(#0()) , compare#2(::(@y, @ys), @x, @xs) -> compare#3(compare(@xs, @ys), @x, @y) , compare#2(nil(), @x, @xs) -> #abs(#0()) , compare#3(@r, @x, @y) -> compare#4(#equal(@r, #0()), @r, @x, @y) , compare#4(#false(), @r, @x, @y) -> @r , compare#4(#true(), @r, @x, @y) -> compare#5(#less(@x, @y), @x, @y) , compare#5(#false(), @x, @y) -> compare#6(#greater(@x, @y)) , compare#5(#true(), @x, @y) -> -(#0(), #pos(#s(#0()))) , compare#6(#false()) -> #abs(#0()) , compare#6(#true()) -> #abs(#pos(#s(#0()))) , diff(@x, @y, @r) -> tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))), diff#1(#less(-(-(@x, @y), @r), #0()))) , mod(@x, @y) -> -(@x, *(@y, div(@x, @y))) , diff#1(#false()) -> #abs(#0()) , diff#1(#true()) -> #abs(#pos(#s(#0()))) , div(@x, @y) -> #div(@x, @y) , #div(#0(), #0()) -> #divByZero() , #div(#0(), #neg(@y)) -> #0() , #div(#0(), #pos(@y)) -> #0() , #div(#neg(@x), #0()) -> #divByZero() , #div(#neg(@x), #neg(@y)) -> #positive(#natdiv(@x, @y)) , #div(#neg(@x), #pos(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #0()) -> #divByZero() , #div(#pos(@x), #neg(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #pos(@y)) -> #positive(#natdiv(@x, @y)) , leq(@b1, @b2) -> #less(compare(@b1, @b2), #pos(#s(#0()))) , mult(@b1, @b2) -> mult#1(@b1, @b2) , mult#1(::(@x, @xs), @b2) -> mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x) , mult#1(nil(), @b2) -> nil() , mult#2(@zs, @b2, @x) -> mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs) , mult#3(#false(), @b2, @zs) -> @zs , mult#3(#true(), @b2, @zs) -> add(@b2, @zs) , mult3(@b1, @b2, @b3) -> mult(mult(@b1, @b2), @b2) , sub(@b1, @b2) -> sub#1(sub'(@b1, @b2, #abs(#0()))) , sub'(@b1, @b2, @r) -> sub'#1(@b1, @b2, @r) , sub#1(tuple#2(@b, @_@1)) -> @b , sub'#1(::(@x, @xs), @b2, @r) -> sub'#2(@b2, @r, @x, @xs) , sub'#1(nil(), @b2, @r) -> tuple#2(nil(), @r) , sub'#2(::(@y, @ys), @r, @x, @xs) -> sub'#3(diff(@x, @y, @r), @xs, @ys) , sub'#2(nil(), @r, @x, @xs) -> tuple#2(nil(), @r) , sub'#3(tuple#2(@z, @r'), @xs, @ys) -> sub'#4(sub'(@xs, @ys, @r'), @z) , sub'#4(tuple#2(@zs, @s), @z) -> tuple#2(sub'#5(#equal(@s, #pos(#s(#0()))), @z, @zs), @s) , sub'#5(#false(), @z, @zs) -> ::(@z, @zs) , sub'#5(#true(), @z, @zs) -> ::(#abs(#0()), @zs) , sum#1(@s) -> sum#2(#equal(@s, #0()), @s) , sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s) , sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0())) , sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0()))))) , sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0())) , sum#4(#false()) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0())))) , sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0())))) , #pred(#0()) -> #neg(#s(#0())) , #pred(#neg(#s(@x))) -> #neg(#s(#s(@x))) , #pred(#pos(#s(#0()))) -> #0() , #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x)) , #succ(#0()) -> #pos(#s(#0())) , #succ(#neg(#s(#0()))) -> #0() , #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x)) , #succ(#pos(#s(@x))) -> #pos(#s(#s(@x))) , #and(#false(), #false()) -> #false() , #and(#false(), #true()) -> #false() , #and(#true(), #false()) -> #false() , #and(#true(), #true()) -> #true() , #natdiv(#0(), #0()) -> #divByZero() , #natdiv(#0(), #s(@y)) -> #0() , #natdiv(#s(@x), #0()) -> #divByZero() , #natdiv(#s(@x), #s(@y)) -> #natdiv'(#divsub(@x, @y), #s(@y)) , #positive(#0()) -> #0() , #positive(#neg(@x)) -> #neg(@x) , #positive(#pos(@x)) -> #pos(@x) , #positive(#s(@x)) -> #pos(#s(@x)) , #negative(#0()) -> #0() , #negative(#neg(@x)) -> #pos(@x) , #negative(#pos(@x)) -> #neg(@x) , #negative(#s(@x)) -> #neg(#s(@x)) , #divsub(#0(), #0()) -> #0() , #divsub(#0(), #s(@y)) -> #underflow() , #divsub(#s(@x), #0()) -> #s(@x) , #divsub(#s(@x), #s(@y)) -> #divsub(@x, @y) , #natmult(#0(), @y) -> #0() , #natmult(#s(@x), @y) -> #natadd(@y, #natmult(@x, @y)) , #natadd(#0(), @y) -> @y , #natadd(#s(@x), @y) -> #s(#natadd(@x, @y)) , #natdiv'(#0(), @y) -> #s(#0()) , #natdiv'(#s(@x), @y) -> #s(#natdiv(#s(@x), @y)) , #natdiv'(#underflow(), @y) -> #0() , #natsub(@x, #0()) -> @x , #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) } StartTerms: basic terms Strategy: innermost This problem was proven YES(O(1),O(n^1)). S) Strict DPs: { compare^#(@b1, @b2) -> c_9(compare#1^#(@b1, @b2)) , compare#1^#(::(@x, @xs), @b2) -> c_10(compare#2^#(@b2, @x, @xs)) , compare#2^#(::(@y, @ys), @x, @xs) -> c_11(compare^#(@xs, @ys)) , leq^#(@b1, @b2) -> c_12(compare^#(@b1, @b2)) , sub^#(@b1, @b2) -> c_18(sub'^#(@b1, @b2, #abs(#0()))) , sub'^#(@b1, @b2, @r) -> c_19(sub'#1^#(@b1, @b2, @r)) , sub'#1^#(::(@x, @xs), @b2, @r) -> c_20(sub'#2^#(@b2, @r, @x, @xs)) , sub'#2^#(::(@y, @ys), @r, @x, @xs) -> c_21(sub'#3^#(diff(@x, @y, @r), @xs, @ys)) , sub'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_22(sub'^#(@xs, @ys, @r')) } Weak DPs: { bitToInt^#(@b) -> c_6(bitToInt'^#(@b, #abs(#pos(#s(#0()))))) , bitToInt'^#(@b, @n) -> c_7(bitToInt'#1^#(@b, @n)) , bitToInt'#1^#(::(@x, @xs), @n) -> c_8(bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0())))))) } Weak Trs: { #abs(#0()) -> #0() , #abs(#neg(@x)) -> #pos(@x) , #abs(#pos(@x)) -> #pos(@x) , #abs(#s(@x)) -> #pos(#s(@x)) , #equal(@x, @y) -> #eq(@x, @y) , #eq(#0(), #0()) -> #true() , #eq(#0(), #neg(@y)) -> #false() , #eq(#0(), #pos(@y)) -> #false() , #eq(#0(), #s(@y)) -> #false() , #eq(#neg(@x), #0()) -> #false() , #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #pos(@y)) -> #false() , #eq(#pos(@x), #0()) -> #false() , #eq(#pos(@x), #neg(@y)) -> #false() , #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y) , #eq(#s(@x), #0()) -> #false() , #eq(#s(@x), #s(@y)) -> #eq(@x, @y) , #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #eq(::(@x_1, @x_2), nil()) -> #false() , #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false() , #eq(nil(), ::(@y_1, @y_2)) -> #false() , #eq(nil(), nil()) -> #true() , #eq(nil(), tuple#2(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), nil()) -> #false() , #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #greater(@x, @y) -> #ckgt(#compare(@x, @y)) , #compare(#0(), #0()) -> #EQ() , #compare(#0(), #neg(@y)) -> #GT() , #compare(#0(), #pos(@y)) -> #LT() , #compare(#0(), #s(@y)) -> #LT() , #compare(#neg(@x), #0()) -> #LT() , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x) , #compare(#neg(@x), #pos(@y)) -> #LT() , #compare(#pos(@x), #0()) -> #GT() , #compare(#pos(@x), #neg(@y)) -> #GT() , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y) , #compare(#s(@x), #0()) -> #GT() , #compare(#s(@x), #s(@y)) -> #compare(@x, @y) , #ckgt(#EQ()) -> #false() , #ckgt(#GT()) -> #true() , #ckgt(#LT()) -> #false() , #less(@x, @y) -> #cklt(#compare(@x, @y)) , #cklt(#EQ()) -> #false() , #cklt(#GT()) -> #false() , #cklt(#LT()) -> #true() , *(@x, @y) -> #mult(@x, @y) , #mult(#0(), #0()) -> #0() , #mult(#0(), #neg(@y)) -> #0() , #mult(#0(), #pos(@y)) -> #0() , #mult(#neg(@x), #0()) -> #0() , #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y)) , #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #0()) -> #0() , #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y)) , +(@x, @y) -> #add(@x, @y) , #add(#0(), @y) -> @y , #add(#neg(#s(#0())), @y) -> #pred(@y) , #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y)) , #add(#pos(#s(#0())), @y) -> #succ(@y) , #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y)) , -(@x, @y) -> #sub(@x, @y) , #sub(@x, #0()) -> @x , #sub(@x, #neg(@y)) -> #add(@x, #pos(@y)) , #sub(@x, #pos(@y)) -> #add(@x, #neg(@y)) , add(@b1, @b2) -> add'(@b1, @b2, #abs(#0())) , add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r) , add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs) , add'#1(nil(), @b2, @r) -> nil() , add'#2(::(@y, @ys), @r, @x, @xs) -> add'#3(sum(@x, @y, @r), @xs, @ys) , add'#2(nil(), @r, @x, @xs) -> nil() , sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r)) , add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r')) , bitToInt(@b) -> bitToInt'(@b, #abs(#pos(#s(#0())))) , bitToInt'(@b, @n) -> bitToInt'#1(@b, @n) , bitToInt'#1(::(@x, @xs), @n) -> +(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))) , bitToInt'#1(nil(), @n) -> #abs(#0()) , compare(@b1, @b2) -> compare#1(@b1, @b2) , compare#1(::(@x, @xs), @b2) -> compare#2(@b2, @x, @xs) , compare#1(nil(), @b2) -> #abs(#0()) , compare#2(::(@y, @ys), @x, @xs) -> compare#3(compare(@xs, @ys), @x, @y) , compare#2(nil(), @x, @xs) -> #abs(#0()) , compare#3(@r, @x, @y) -> compare#4(#equal(@r, #0()), @r, @x, @y) , compare#4(#false(), @r, @x, @y) -> @r , compare#4(#true(), @r, @x, @y) -> compare#5(#less(@x, @y), @x, @y) , compare#5(#false(), @x, @y) -> compare#6(#greater(@x, @y)) , compare#5(#true(), @x, @y) -> -(#0(), #pos(#s(#0()))) , compare#6(#false()) -> #abs(#0()) , compare#6(#true()) -> #abs(#pos(#s(#0()))) , diff(@x, @y, @r) -> tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))), diff#1(#less(-(-(@x, @y), @r), #0()))) , mod(@x, @y) -> -(@x, *(@y, div(@x, @y))) , diff#1(#false()) -> #abs(#0()) , diff#1(#true()) -> #abs(#pos(#s(#0()))) , div(@x, @y) -> #div(@x, @y) , #div(#0(), #0()) -> #divByZero() , #div(#0(), #neg(@y)) -> #0() , #div(#0(), #pos(@y)) -> #0() , #div(#neg(@x), #0()) -> #divByZero() , #div(#neg(@x), #neg(@y)) -> #positive(#natdiv(@x, @y)) , #div(#neg(@x), #pos(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #0()) -> #divByZero() , #div(#pos(@x), #neg(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #pos(@y)) -> #positive(#natdiv(@x, @y)) , leq(@b1, @b2) -> #less(compare(@b1, @b2), #pos(#s(#0()))) , mult(@b1, @b2) -> mult#1(@b1, @b2) , mult#1(::(@x, @xs), @b2) -> mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x) , mult#1(nil(), @b2) -> nil() , mult#2(@zs, @b2, @x) -> mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs) , mult#3(#false(), @b2, @zs) -> @zs , mult#3(#true(), @b2, @zs) -> add(@b2, @zs) , mult3(@b1, @b2, @b3) -> mult(mult(@b1, @b2), @b2) , sub(@b1, @b2) -> sub#1(sub'(@b1, @b2, #abs(#0()))) , sub'(@b1, @b2, @r) -> sub'#1(@b1, @b2, @r) , sub#1(tuple#2(@b, @_@1)) -> @b , sub'#1(::(@x, @xs), @b2, @r) -> sub'#2(@b2, @r, @x, @xs) , sub'#1(nil(), @b2, @r) -> tuple#2(nil(), @r) , sub'#2(::(@y, @ys), @r, @x, @xs) -> sub'#3(diff(@x, @y, @r), @xs, @ys) , sub'#2(nil(), @r, @x, @xs) -> tuple#2(nil(), @r) , sub'#3(tuple#2(@z, @r'), @xs, @ys) -> sub'#4(sub'(@xs, @ys, @r'), @z) , sub'#4(tuple#2(@zs, @s), @z) -> tuple#2(sub'#5(#equal(@s, #pos(#s(#0()))), @z, @zs), @s) , sub'#5(#false(), @z, @zs) -> ::(@z, @zs) , sub'#5(#true(), @z, @zs) -> ::(#abs(#0()), @zs) , sum#1(@s) -> sum#2(#equal(@s, #0()), @s) , sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s) , sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0())) , sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0()))))) , sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0())) , sum#4(#false()) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0())))) , sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0())))) , #pred(#0()) -> #neg(#s(#0())) , #pred(#neg(#s(@x))) -> #neg(#s(#s(@x))) , #pred(#pos(#s(#0()))) -> #0() , #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x)) , #succ(#0()) -> #pos(#s(#0())) , #succ(#neg(#s(#0()))) -> #0() , #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x)) , #succ(#pos(#s(@x))) -> #pos(#s(#s(@x))) , #and(#false(), #false()) -> #false() , #and(#false(), #true()) -> #false() , #and(#true(), #false()) -> #false() , #and(#true(), #true()) -> #true() , #natdiv(#0(), #0()) -> #divByZero() , #natdiv(#0(), #s(@y)) -> #0() , #natdiv(#s(@x), #0()) -> #divByZero() , #natdiv(#s(@x), #s(@y)) -> #natdiv'(#divsub(@x, @y), #s(@y)) , #positive(#0()) -> #0() , #positive(#neg(@x)) -> #neg(@x) , #positive(#pos(@x)) -> #pos(@x) , #positive(#s(@x)) -> #pos(#s(@x)) , #negative(#0()) -> #0() , #negative(#neg(@x)) -> #pos(@x) , #negative(#pos(@x)) -> #neg(@x) , #negative(#s(@x)) -> #neg(#s(@x)) , #divsub(#0(), #0()) -> #0() , #divsub(#0(), #s(@y)) -> #underflow() , #divsub(#s(@x), #0()) -> #s(@x) , #divsub(#s(@x), #s(@y)) -> #divsub(@x, @y) , #natmult(#0(), @y) -> #0() , #natmult(#s(@x), @y) -> #natadd(@y, #natmult(@x, @y)) , #natadd(#0(), @y) -> @y , #natadd(#s(@x), @y) -> #s(#natadd(@x, @y)) , #natdiv'(#0(), @y) -> #s(#0()) , #natdiv'(#s(@x), @y) -> #s(#natdiv(#s(@x), @y)) , #natdiv'(#underflow(), @y) -> #0() , #natsub(@x, #0()) -> @x , #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) } StartTerms: basic terms Strategy: innermost This problem was proven YES(O(1),O(n^1)). Proofs for generated problems: ------------------------------ R) We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^1)). Strict DPs: { bitToInt^#(@b) -> c_6(bitToInt'^#(@b, #abs(#pos(#s(#0()))))) , bitToInt'^#(@b, @n) -> c_7(bitToInt'#1^#(@b, @n)) , bitToInt'#1^#(::(@x, @xs), @n) -> c_8(bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0())))))) } Weak DPs: { compare^#(@b1, @b2) -> c_9(compare#1^#(@b1, @b2)) , compare#1^#(::(@x, @xs), @b2) -> c_10(compare#2^#(@b2, @x, @xs)) , compare#2^#(::(@y, @ys), @x, @xs) -> c_11(compare^#(@xs, @ys)) , leq^#(@b1, @b2) -> c_12(compare^#(@b1, @b2)) , sub^#(@b1, @b2) -> c_18(sub'^#(@b1, @b2, #abs(#0()))) , sub'^#(@b1, @b2, @r) -> c_19(sub'#1^#(@b1, @b2, @r)) , sub'#1^#(::(@x, @xs), @b2, @r) -> c_20(sub'#2^#(@b2, @r, @x, @xs)) , sub'#2^#(::(@y, @ys), @r, @x, @xs) -> c_21(sub'#3^#(diff(@x, @y, @r), @xs, @ys)) , sub'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_22(sub'^#(@xs, @ys, @r')) } Weak Trs: { #abs(#0()) -> #0() , #abs(#neg(@x)) -> #pos(@x) , #abs(#pos(@x)) -> #pos(@x) , #abs(#s(@x)) -> #pos(#s(@x)) , #equal(@x, @y) -> #eq(@x, @y) , #eq(#0(), #0()) -> #true() , #eq(#0(), #neg(@y)) -> #false() , #eq(#0(), #pos(@y)) -> #false() , #eq(#0(), #s(@y)) -> #false() , #eq(#neg(@x), #0()) -> #false() , #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #pos(@y)) -> #false() , #eq(#pos(@x), #0()) -> #false() , #eq(#pos(@x), #neg(@y)) -> #false() , #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y) , #eq(#s(@x), #0()) -> #false() , #eq(#s(@x), #s(@y)) -> #eq(@x, @y) , #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #eq(::(@x_1, @x_2), nil()) -> #false() , #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false() , #eq(nil(), ::(@y_1, @y_2)) -> #false() , #eq(nil(), nil()) -> #true() , #eq(nil(), tuple#2(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), nil()) -> #false() , #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #greater(@x, @y) -> #ckgt(#compare(@x, @y)) , #compare(#0(), #0()) -> #EQ() , #compare(#0(), #neg(@y)) -> #GT() , #compare(#0(), #pos(@y)) -> #LT() , #compare(#0(), #s(@y)) -> #LT() , #compare(#neg(@x), #0()) -> #LT() , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x) , #compare(#neg(@x), #pos(@y)) -> #LT() , #compare(#pos(@x), #0()) -> #GT() , #compare(#pos(@x), #neg(@y)) -> #GT() , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y) , #compare(#s(@x), #0()) -> #GT() , #compare(#s(@x), #s(@y)) -> #compare(@x, @y) , #ckgt(#EQ()) -> #false() , #ckgt(#GT()) -> #true() , #ckgt(#LT()) -> #false() , #less(@x, @y) -> #cklt(#compare(@x, @y)) , #cklt(#EQ()) -> #false() , #cklt(#GT()) -> #false() , #cklt(#LT()) -> #true() , *(@x, @y) -> #mult(@x, @y) , #mult(#0(), #0()) -> #0() , #mult(#0(), #neg(@y)) -> #0() , #mult(#0(), #pos(@y)) -> #0() , #mult(#neg(@x), #0()) -> #0() , #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y)) , #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #0()) -> #0() , #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y)) , +(@x, @y) -> #add(@x, @y) , #add(#0(), @y) -> @y , #add(#neg(#s(#0())), @y) -> #pred(@y) , #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y)) , #add(#pos(#s(#0())), @y) -> #succ(@y) , #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y)) , -(@x, @y) -> #sub(@x, @y) , #sub(@x, #0()) -> @x , #sub(@x, #neg(@y)) -> #add(@x, #pos(@y)) , #sub(@x, #pos(@y)) -> #add(@x, #neg(@y)) , add(@b1, @b2) -> add'(@b1, @b2, #abs(#0())) , add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r) , add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs) , add'#1(nil(), @b2, @r) -> nil() , add'#2(::(@y, @ys), @r, @x, @xs) -> add'#3(sum(@x, @y, @r), @xs, @ys) , add'#2(nil(), @r, @x, @xs) -> nil() , sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r)) , add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r')) , bitToInt(@b) -> bitToInt'(@b, #abs(#pos(#s(#0())))) , bitToInt'(@b, @n) -> bitToInt'#1(@b, @n) , bitToInt'#1(::(@x, @xs), @n) -> +(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))) , bitToInt'#1(nil(), @n) -> #abs(#0()) , compare(@b1, @b2) -> compare#1(@b1, @b2) , compare#1(::(@x, @xs), @b2) -> compare#2(@b2, @x, @xs) , compare#1(nil(), @b2) -> #abs(#0()) , compare#2(::(@y, @ys), @x, @xs) -> compare#3(compare(@xs, @ys), @x, @y) , compare#2(nil(), @x, @xs) -> #abs(#0()) , compare#3(@r, @x, @y) -> compare#4(#equal(@r, #0()), @r, @x, @y) , compare#4(#false(), @r, @x, @y) -> @r , compare#4(#true(), @r, @x, @y) -> compare#5(#less(@x, @y), @x, @y) , compare#5(#false(), @x, @y) -> compare#6(#greater(@x, @y)) , compare#5(#true(), @x, @y) -> -(#0(), #pos(#s(#0()))) , compare#6(#false()) -> #abs(#0()) , compare#6(#true()) -> #abs(#pos(#s(#0()))) , diff(@x, @y, @r) -> tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))), diff#1(#less(-(-(@x, @y), @r), #0()))) , mod(@x, @y) -> -(@x, *(@y, div(@x, @y))) , diff#1(#false()) -> #abs(#0()) , diff#1(#true()) -> #abs(#pos(#s(#0()))) , div(@x, @y) -> #div(@x, @y) , #div(#0(), #0()) -> #divByZero() , #div(#0(), #neg(@y)) -> #0() , #div(#0(), #pos(@y)) -> #0() , #div(#neg(@x), #0()) -> #divByZero() , #div(#neg(@x), #neg(@y)) -> #positive(#natdiv(@x, @y)) , #div(#neg(@x), #pos(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #0()) -> #divByZero() , #div(#pos(@x), #neg(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #pos(@y)) -> #positive(#natdiv(@x, @y)) , leq(@b1, @b2) -> #less(compare(@b1, @b2), #pos(#s(#0()))) , mult(@b1, @b2) -> mult#1(@b1, @b2) , mult#1(::(@x, @xs), @b2) -> mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x) , mult#1(nil(), @b2) -> nil() , mult#2(@zs, @b2, @x) -> mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs) , mult#3(#false(), @b2, @zs) -> @zs , mult#3(#true(), @b2, @zs) -> add(@b2, @zs) , mult3(@b1, @b2, @b3) -> mult(mult(@b1, @b2), @b2) , sub(@b1, @b2) -> sub#1(sub'(@b1, @b2, #abs(#0()))) , sub'(@b1, @b2, @r) -> sub'#1(@b1, @b2, @r) , sub#1(tuple#2(@b, @_@1)) -> @b , sub'#1(::(@x, @xs), @b2, @r) -> sub'#2(@b2, @r, @x, @xs) , sub'#1(nil(), @b2, @r) -> tuple#2(nil(), @r) , sub'#2(::(@y, @ys), @r, @x, @xs) -> sub'#3(diff(@x, @y, @r), @xs, @ys) , sub'#2(nil(), @r, @x, @xs) -> tuple#2(nil(), @r) , sub'#3(tuple#2(@z, @r'), @xs, @ys) -> sub'#4(sub'(@xs, @ys, @r'), @z) , sub'#4(tuple#2(@zs, @s), @z) -> tuple#2(sub'#5(#equal(@s, #pos(#s(#0()))), @z, @zs), @s) , sub'#5(#false(), @z, @zs) -> ::(@z, @zs) , sub'#5(#true(), @z, @zs) -> ::(#abs(#0()), @zs) , sum#1(@s) -> sum#2(#equal(@s, #0()), @s) , sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s) , sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0())) , sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0()))))) , sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0())) , sum#4(#false()) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0())))) , sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0())))) , #pred(#0()) -> #neg(#s(#0())) , #pred(#neg(#s(@x))) -> #neg(#s(#s(@x))) , #pred(#pos(#s(#0()))) -> #0() , #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x)) , #succ(#0()) -> #pos(#s(#0())) , #succ(#neg(#s(#0()))) -> #0() , #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x)) , #succ(#pos(#s(@x))) -> #pos(#s(#s(@x))) , #and(#false(), #false()) -> #false() , #and(#false(), #true()) -> #false() , #and(#true(), #false()) -> #false() , #and(#true(), #true()) -> #true() , #natdiv(#0(), #0()) -> #divByZero() , #natdiv(#0(), #s(@y)) -> #0() , #natdiv(#s(@x), #0()) -> #divByZero() , #natdiv(#s(@x), #s(@y)) -> #natdiv'(#divsub(@x, @y), #s(@y)) , #positive(#0()) -> #0() , #positive(#neg(@x)) -> #neg(@x) , #positive(#pos(@x)) -> #pos(@x) , #positive(#s(@x)) -> #pos(#s(@x)) , #negative(#0()) -> #0() , #negative(#neg(@x)) -> #pos(@x) , #negative(#pos(@x)) -> #neg(@x) , #negative(#s(@x)) -> #neg(#s(@x)) , #divsub(#0(), #0()) -> #0() , #divsub(#0(), #s(@y)) -> #underflow() , #divsub(#s(@x), #0()) -> #s(@x) , #divsub(#s(@x), #s(@y)) -> #divsub(@x, @y) , #natmult(#0(), @y) -> #0() , #natmult(#s(@x), @y) -> #natadd(@y, #natmult(@x, @y)) , #natadd(#0(), @y) -> @y , #natadd(#s(@x), @y) -> #s(#natadd(@x, @y)) , #natdiv'(#0(), @y) -> #s(#0()) , #natdiv'(#s(@x), @y) -> #s(#natdiv(#s(@x), @y)) , #natdiv'(#underflow(), @y) -> #0() , #natsub(@x, #0()) -> @x , #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^1)) The following weak DPs constitute a sub-graph of the DG that is closed under successors. The DPs are removed. { compare^#(@b1, @b2) -> c_9(compare#1^#(@b1, @b2)) , compare#1^#(::(@x, @xs), @b2) -> c_10(compare#2^#(@b2, @x, @xs)) , compare#2^#(::(@y, @ys), @x, @xs) -> c_11(compare^#(@xs, @ys)) , leq^#(@b1, @b2) -> c_12(compare^#(@b1, @b2)) , sub^#(@b1, @b2) -> c_18(sub'^#(@b1, @b2, #abs(#0()))) , sub'^#(@b1, @b2, @r) -> c_19(sub'#1^#(@b1, @b2, @r)) , sub'#1^#(::(@x, @xs), @b2, @r) -> c_20(sub'#2^#(@b2, @r, @x, @xs)) , sub'#2^#(::(@y, @ys), @r, @x, @xs) -> c_21(sub'#3^#(diff(@x, @y, @r), @xs, @ys)) , sub'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_22(sub'^#(@xs, @ys, @r')) } We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^1)). Strict DPs: { bitToInt^#(@b) -> c_6(bitToInt'^#(@b, #abs(#pos(#s(#0()))))) , bitToInt'^#(@b, @n) -> c_7(bitToInt'#1^#(@b, @n)) , bitToInt'#1^#(::(@x, @xs), @n) -> c_8(bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0())))))) } Weak Trs: { #abs(#0()) -> #0() , #abs(#neg(@x)) -> #pos(@x) , #abs(#pos(@x)) -> #pos(@x) , #abs(#s(@x)) -> #pos(#s(@x)) , #equal(@x, @y) -> #eq(@x, @y) , #eq(#0(), #0()) -> #true() , #eq(#0(), #neg(@y)) -> #false() , #eq(#0(), #pos(@y)) -> #false() , #eq(#0(), #s(@y)) -> #false() , #eq(#neg(@x), #0()) -> #false() , #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #pos(@y)) -> #false() , #eq(#pos(@x), #0()) -> #false() , #eq(#pos(@x), #neg(@y)) -> #false() , #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y) , #eq(#s(@x), #0()) -> #false() , #eq(#s(@x), #s(@y)) -> #eq(@x, @y) , #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #eq(::(@x_1, @x_2), nil()) -> #false() , #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false() , #eq(nil(), ::(@y_1, @y_2)) -> #false() , #eq(nil(), nil()) -> #true() , #eq(nil(), tuple#2(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), nil()) -> #false() , #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #greater(@x, @y) -> #ckgt(#compare(@x, @y)) , #compare(#0(), #0()) -> #EQ() , #compare(#0(), #neg(@y)) -> #GT() , #compare(#0(), #pos(@y)) -> #LT() , #compare(#0(), #s(@y)) -> #LT() , #compare(#neg(@x), #0()) -> #LT() , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x) , #compare(#neg(@x), #pos(@y)) -> #LT() , #compare(#pos(@x), #0()) -> #GT() , #compare(#pos(@x), #neg(@y)) -> #GT() , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y) , #compare(#s(@x), #0()) -> #GT() , #compare(#s(@x), #s(@y)) -> #compare(@x, @y) , #ckgt(#EQ()) -> #false() , #ckgt(#GT()) -> #true() , #ckgt(#LT()) -> #false() , #less(@x, @y) -> #cklt(#compare(@x, @y)) , #cklt(#EQ()) -> #false() , #cklt(#GT()) -> #false() , #cklt(#LT()) -> #true() , *(@x, @y) -> #mult(@x, @y) , #mult(#0(), #0()) -> #0() , #mult(#0(), #neg(@y)) -> #0() , #mult(#0(), #pos(@y)) -> #0() , #mult(#neg(@x), #0()) -> #0() , #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y)) , #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #0()) -> #0() , #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y)) , +(@x, @y) -> #add(@x, @y) , #add(#0(), @y) -> @y , #add(#neg(#s(#0())), @y) -> #pred(@y) , #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y)) , #add(#pos(#s(#0())), @y) -> #succ(@y) , #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y)) , -(@x, @y) -> #sub(@x, @y) , #sub(@x, #0()) -> @x , #sub(@x, #neg(@y)) -> #add(@x, #pos(@y)) , #sub(@x, #pos(@y)) -> #add(@x, #neg(@y)) , add(@b1, @b2) -> add'(@b1, @b2, #abs(#0())) , add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r) , add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs) , add'#1(nil(), @b2, @r) -> nil() , add'#2(::(@y, @ys), @r, @x, @xs) -> add'#3(sum(@x, @y, @r), @xs, @ys) , add'#2(nil(), @r, @x, @xs) -> nil() , sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r)) , add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r')) , bitToInt(@b) -> bitToInt'(@b, #abs(#pos(#s(#0())))) , bitToInt'(@b, @n) -> bitToInt'#1(@b, @n) , bitToInt'#1(::(@x, @xs), @n) -> +(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))) , bitToInt'#1(nil(), @n) -> #abs(#0()) , compare(@b1, @b2) -> compare#1(@b1, @b2) , compare#1(::(@x, @xs), @b2) -> compare#2(@b2, @x, @xs) , compare#1(nil(), @b2) -> #abs(#0()) , compare#2(::(@y, @ys), @x, @xs) -> compare#3(compare(@xs, @ys), @x, @y) , compare#2(nil(), @x, @xs) -> #abs(#0()) , compare#3(@r, @x, @y) -> compare#4(#equal(@r, #0()), @r, @x, @y) , compare#4(#false(), @r, @x, @y) -> @r , compare#4(#true(), @r, @x, @y) -> compare#5(#less(@x, @y), @x, @y) , compare#5(#false(), @x, @y) -> compare#6(#greater(@x, @y)) , compare#5(#true(), @x, @y) -> -(#0(), #pos(#s(#0()))) , compare#6(#false()) -> #abs(#0()) , compare#6(#true()) -> #abs(#pos(#s(#0()))) , diff(@x, @y, @r) -> tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))), diff#1(#less(-(-(@x, @y), @r), #0()))) , mod(@x, @y) -> -(@x, *(@y, div(@x, @y))) , diff#1(#false()) -> #abs(#0()) , diff#1(#true()) -> #abs(#pos(#s(#0()))) , div(@x, @y) -> #div(@x, @y) , #div(#0(), #0()) -> #divByZero() , #div(#0(), #neg(@y)) -> #0() , #div(#0(), #pos(@y)) -> #0() , #div(#neg(@x), #0()) -> #divByZero() , #div(#neg(@x), #neg(@y)) -> #positive(#natdiv(@x, @y)) , #div(#neg(@x), #pos(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #0()) -> #divByZero() , #div(#pos(@x), #neg(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #pos(@y)) -> #positive(#natdiv(@x, @y)) , leq(@b1, @b2) -> #less(compare(@b1, @b2), #pos(#s(#0()))) , mult(@b1, @b2) -> mult#1(@b1, @b2) , mult#1(::(@x, @xs), @b2) -> mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x) , mult#1(nil(), @b2) -> nil() , mult#2(@zs, @b2, @x) -> mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs) , mult#3(#false(), @b2, @zs) -> @zs , mult#3(#true(), @b2, @zs) -> add(@b2, @zs) , mult3(@b1, @b2, @b3) -> mult(mult(@b1, @b2), @b2) , sub(@b1, @b2) -> sub#1(sub'(@b1, @b2, #abs(#0()))) , sub'(@b1, @b2, @r) -> sub'#1(@b1, @b2, @r) , sub#1(tuple#2(@b, @_@1)) -> @b , sub'#1(::(@x, @xs), @b2, @r) -> sub'#2(@b2, @r, @x, @xs) , sub'#1(nil(), @b2, @r) -> tuple#2(nil(), @r) , sub'#2(::(@y, @ys), @r, @x, @xs) -> sub'#3(diff(@x, @y, @r), @xs, @ys) , sub'#2(nil(), @r, @x, @xs) -> tuple#2(nil(), @r) , sub'#3(tuple#2(@z, @r'), @xs, @ys) -> sub'#4(sub'(@xs, @ys, @r'), @z) , sub'#4(tuple#2(@zs, @s), @z) -> tuple#2(sub'#5(#equal(@s, #pos(#s(#0()))), @z, @zs), @s) , sub'#5(#false(), @z, @zs) -> ::(@z, @zs) , sub'#5(#true(), @z, @zs) -> ::(#abs(#0()), @zs) , sum#1(@s) -> sum#2(#equal(@s, #0()), @s) , sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s) , sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0())) , sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0()))))) , sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0())) , sum#4(#false()) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0())))) , sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0())))) , #pred(#0()) -> #neg(#s(#0())) , #pred(#neg(#s(@x))) -> #neg(#s(#s(@x))) , #pred(#pos(#s(#0()))) -> #0() , #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x)) , #succ(#0()) -> #pos(#s(#0())) , #succ(#neg(#s(#0()))) -> #0() , #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x)) , #succ(#pos(#s(@x))) -> #pos(#s(#s(@x))) , #and(#false(), #false()) -> #false() , #and(#false(), #true()) -> #false() , #and(#true(), #false()) -> #false() , #and(#true(), #true()) -> #true() , #natdiv(#0(), #0()) -> #divByZero() , #natdiv(#0(), #s(@y)) -> #0() , #natdiv(#s(@x), #0()) -> #divByZero() , #natdiv(#s(@x), #s(@y)) -> #natdiv'(#divsub(@x, @y), #s(@y)) , #positive(#0()) -> #0() , #positive(#neg(@x)) -> #neg(@x) , #positive(#pos(@x)) -> #pos(@x) , #positive(#s(@x)) -> #pos(#s(@x)) , #negative(#0()) -> #0() , #negative(#neg(@x)) -> #pos(@x) , #negative(#pos(@x)) -> #neg(@x) , #negative(#s(@x)) -> #neg(#s(@x)) , #divsub(#0(), #0()) -> #0() , #divsub(#0(), #s(@y)) -> #underflow() , #divsub(#s(@x), #0()) -> #s(@x) , #divsub(#s(@x), #s(@y)) -> #divsub(@x, @y) , #natmult(#0(), @y) -> #0() , #natmult(#s(@x), @y) -> #natadd(@y, #natmult(@x, @y)) , #natadd(#0(), @y) -> @y , #natadd(#s(@x), @y) -> #s(#natadd(@x, @y)) , #natdiv'(#0(), @y) -> #s(#0()) , #natdiv'(#s(@x), @y) -> #s(#natdiv(#s(@x), @y)) , #natdiv'(#underflow(), @y) -> #0() , #natsub(@x, #0()) -> @x , #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^1)) We replace rewrite rules by usable rules: Weak Usable Rules: { #abs(#0()) -> #0() , #abs(#neg(@x)) -> #pos(@x) , #abs(#pos(@x)) -> #pos(@x) , #abs(#s(@x)) -> #pos(#s(@x)) , *(@x, @y) -> #mult(@x, @y) , #mult(#0(), #0()) -> #0() , #mult(#0(), #neg(@y)) -> #0() , #mult(#0(), #pos(@y)) -> #0() , #mult(#neg(@x), #0()) -> #0() , #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y)) , #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #0()) -> #0() , #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y)) , #natmult(#0(), @y) -> #0() , #natmult(#s(@x), @y) -> #natadd(@y, #natmult(@x, @y)) , #natadd(#0(), @y) -> @y , #natadd(#s(@x), @y) -> #s(#natadd(@x, @y)) } We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^1)). Strict DPs: { bitToInt^#(@b) -> c_6(bitToInt'^#(@b, #abs(#pos(#s(#0()))))) , bitToInt'^#(@b, @n) -> c_7(bitToInt'#1^#(@b, @n)) , bitToInt'#1^#(::(@x, @xs), @n) -> c_8(bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0())))))) } Weak Trs: { #abs(#0()) -> #0() , #abs(#neg(@x)) -> #pos(@x) , #abs(#pos(@x)) -> #pos(@x) , #abs(#s(@x)) -> #pos(#s(@x)) , *(@x, @y) -> #mult(@x, @y) , #mult(#0(), #0()) -> #0() , #mult(#0(), #neg(@y)) -> #0() , #mult(#0(), #pos(@y)) -> #0() , #mult(#neg(@x), #0()) -> #0() , #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y)) , #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #0()) -> #0() , #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y)) , #natmult(#0(), @y) -> #0() , #natmult(#s(@x), @y) -> #natadd(@y, #natmult(@x, @y)) , #natadd(#0(), @y) -> @y , #natadd(#s(@x), @y) -> #s(#natadd(@x, @y)) } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^1)) We use the processor 'matrix interpretation of dimension 1' to orient following rules strictly. DPs: { 2: bitToInt'^#(@b, @n) -> c_7(bitToInt'#1^#(@b, @n)) } Trs: { #abs(#s(@x)) -> #pos(#s(@x)) } Sub-proof: ---------- The following argument positions are usable: Uargs(c_6) = {1}, Uargs(c_7) = {1}, Uargs(c_8) = {1} TcT has computed following constructor-based matrix interpretation satisfying not(EDA). [#0] = [0] [#abs](x1) = [1] x1 + [0] [#neg](x1) = [0] [#pos](x1) = [0] [#s](x1) = [1] x1 + [1] [*](x1, x2) = [1] x1 + [1] [#mult](x1, x2) = [1] x1 + [1] x2 + [0] [::](x1, x2) = [1] x2 + [1] [nil] = [0] [tuple#2](x1, x2) = [0] [#false] = [0] [#true] = [0] [#EQ] = [0] [#GT] = [0] [#LT] = [0] [#divByZero] = [0] [#underflow] = [0] [#natmult](x1, x2) = [1] x1 + [0] [#natadd](x1, x2) = [1] x1 + [0] [#abs^#](x1) = [0] [#equal^#](x1, x2) = [0] [#eq^#](x1, x2) = [0] [#greater^#](x1, x2) = [0] [#ckgt^#](x1) = [0] [#compare^#](x1, x2) = [0] [#less^#](x1, x2) = [0] [#cklt^#](x1) = [0] [*^#](x1, x2) = [0] [#mult^#](x1, x2) = [0] [+^#](x1, x2) = [0] [#add^#](x1, x2) = [0] [-^#](x1, x2) = [0] [#sub^#](x1, x2) = [0] [add^#](x1, x2) = [0] [add'^#](x1, x2, x3) = [0] [add'#1^#](x1, x2, x3) = [0] [add'#2^#](x1, x2, x3, x4) = [0] [add'#3^#](x1, x2, x3) = [0] [sum^#](x1, x2, x3) = [0] [sum#1^#](x1) = [0] [bitToInt^#](x1) = [1] x1 + [1] [bitToInt'^#](x1, x2) = [1] x1 + [1] [bitToInt'#1^#](x1, x2) = [1] x1 + [0] [compare^#](x1, x2) = [0] [compare#1^#](x1, x2) = [0] [compare#2^#](x1, x2, x3) = [0] [compare#3^#](x1, x2, x3) = [0] [compare#4^#](x1, x2, x3, x4) = [0] [compare#5^#](x1, x2, x3) = [0] [compare#6^#](x1) = [0] [diff^#](x1, x2, x3) = [0] [mod^#](x1, x2) = [0] [diff#1^#](x1) = [0] [div^#](x1, x2) = [0] [#div^#](x1, x2) = [0] [leq^#](x1, x2) = [0] [mult^#](x1, x2) = [0] [mult#1^#](x1, x2) = [0] [mult#2^#](x1, x2, x3) = [0] [mult#3^#](x1, x2, x3) = [0] [mult3^#](x1, x2, x3) = [0] [sub^#](x1, x2) = [0] [sub#1^#](x1) = [0] [sub'^#](x1, x2, x3) = [0] [sub'#1^#](x1, x2, x3) = [0] [sub'#2^#](x1, x2, x3, x4) = [0] [sub'#3^#](x1, x2, x3) = [0] [sub'#4^#](x1, x2) = [0] [sub'#5^#](x1, x2, x3) = [0] [sum#2^#](x1, x2) = [0] [sum#3^#](x1, x2) = [0] [sum#4^#](x1) = [0] [#and^#](x1, x2) = [0] [#natmult^#](x1, x2) = [0] [#pred^#](x1) = [0] [#succ^#](x1) = [0] [#positive^#](x1) = [0] [#natdiv^#](x1, x2) = [0] [#negative^#](x1) = [0] [#natdiv'^#](x1, x2) = [0] [#divsub^#](x1, x2) = [0] [#natadd^#](x1, x2) = [0] [#natsub^#](x1, x2) = [0] [c_6](x1) = [1] x1 + [0] [c_7](x1) = [1] x1 + [0] [c_8](x1) = [1] x1 + [0] This order satisfies following ordering constraints [bitToInt^#(@b)] = [1] @b + [1] >= [1] @b + [1] = [c_6(bitToInt'^#(@b, #abs(#pos(#s(#0())))))] [bitToInt'^#(@b, @n)] = [1] @b + [1] > [1] @b + [0] = [c_7(bitToInt'#1^#(@b, @n))] [bitToInt'#1^#(::(@x, @xs), @n)] = [1] @xs + [1] >= [1] @xs + [1] = [c_8(bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))))] Consider the set of all dependency pairs DPs: { 1: bitToInt^#(@b) -> c_6(bitToInt'^#(@b, #abs(#pos(#s(#0()))))) , 2: bitToInt'^#(@b, @n) -> c_7(bitToInt'#1^#(@b, @n)) , 3: bitToInt'#1^#(::(@x, @xs), @n) -> c_8(bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0())))))) } Processor 'matrix interpretation of dimension 1' induces the complexity certificate YES(?,O(n^1)) on application of dependency pairs {2}. These cover all (indirect) predecessors of dependency pairs {1,2,3}, their number of application is equally bounded. The dependency pairs are shifted into the corresponding weak component(s). We apply the transformation 'removetails' on the sub-problem: Weak DPs: { bitToInt^#(@b) -> c_6(bitToInt'^#(@b, #abs(#pos(#s(#0()))))) , bitToInt'^#(@b, @n) -> c_7(bitToInt'#1^#(@b, @n)) , bitToInt'#1^#(::(@x, @xs), @n) -> c_8(bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0())))))) } Weak Trs: { #abs(#0()) -> #0() , #abs(#neg(@x)) -> #pos(@x) , #abs(#pos(@x)) -> #pos(@x) , #abs(#s(@x)) -> #pos(#s(@x)) , *(@x, @y) -> #mult(@x, @y) , #mult(#0(), #0()) -> #0() , #mult(#0(), #neg(@y)) -> #0() , #mult(#0(), #pos(@y)) -> #0() , #mult(#neg(@x), #0()) -> #0() , #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y)) , #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #0()) -> #0() , #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y)) , #natmult(#0(), @y) -> #0() , #natmult(#s(@x), @y) -> #natadd(@y, #natmult(@x, @y)) , #natadd(#0(), @y) -> @y , #natadd(#s(@x), @y) -> #s(#natadd(@x, @y)) } StartTerms: basic terms Strategy: innermost The following weak DPs constitute a sub-graph of the DG that is closed under successors. The DPs are removed. { bitToInt^#(@b) -> c_6(bitToInt'^#(@b, #abs(#pos(#s(#0()))))) , bitToInt'^#(@b, @n) -> c_7(bitToInt'#1^#(@b, @n)) , bitToInt'#1^#(::(@x, @xs), @n) -> c_8(bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0())))))) } We apply the transformation 'usablerules' on the sub-problem: Weak Trs: { #abs(#0()) -> #0() , #abs(#neg(@x)) -> #pos(@x) , #abs(#pos(@x)) -> #pos(@x) , #abs(#s(@x)) -> #pos(#s(@x)) , *(@x, @y) -> #mult(@x, @y) , #mult(#0(), #0()) -> #0() , #mult(#0(), #neg(@y)) -> #0() , #mult(#0(), #pos(@y)) -> #0() , #mult(#neg(@x), #0()) -> #0() , #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y)) , #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #0()) -> #0() , #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y)) , #natmult(#0(), @y) -> #0() , #natmult(#s(@x), @y) -> #natadd(@y, #natmult(@x, @y)) , #natadd(#0(), @y) -> @y , #natadd(#s(@x), @y) -> #s(#natadd(@x, @y)) } StartTerms: basic terms Strategy: innermost No rule is usable, rules are removed from the input problem. We are left with following problem, upon which TcT provides the certificate YES(O(1),O(1)). Rules: Empty Obligation: innermost runtime complexity Answer: YES(O(1),O(1)) Empty rules are trivially bounded Wall-time: 1.098969s CPU-time: 12.6s S) We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^1)). Strict DPs: { compare^#(@b1, @b2) -> c_9(compare#1^#(@b1, @b2)) , compare#1^#(::(@x, @xs), @b2) -> c_10(compare#2^#(@b2, @x, @xs)) , compare#2^#(::(@y, @ys), @x, @xs) -> c_11(compare^#(@xs, @ys)) , leq^#(@b1, @b2) -> c_12(compare^#(@b1, @b2)) , sub^#(@b1, @b2) -> c_18(sub'^#(@b1, @b2, #abs(#0()))) , sub'^#(@b1, @b2, @r) -> c_19(sub'#1^#(@b1, @b2, @r)) , sub'#1^#(::(@x, @xs), @b2, @r) -> c_20(sub'#2^#(@b2, @r, @x, @xs)) , sub'#2^#(::(@y, @ys), @r, @x, @xs) -> c_21(sub'#3^#(diff(@x, @y, @r), @xs, @ys)) , sub'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_22(sub'^#(@xs, @ys, @r')) } Weak DPs: { bitToInt^#(@b) -> c_6(bitToInt'^#(@b, #abs(#pos(#s(#0()))))) , bitToInt'^#(@b, @n) -> c_7(bitToInt'#1^#(@b, @n)) , bitToInt'#1^#(::(@x, @xs), @n) -> c_8(bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0())))))) } Weak Trs: { #abs(#0()) -> #0() , #abs(#neg(@x)) -> #pos(@x) , #abs(#pos(@x)) -> #pos(@x) , #abs(#s(@x)) -> #pos(#s(@x)) , #equal(@x, @y) -> #eq(@x, @y) , #eq(#0(), #0()) -> #true() , #eq(#0(), #neg(@y)) -> #false() , #eq(#0(), #pos(@y)) -> #false() , #eq(#0(), #s(@y)) -> #false() , #eq(#neg(@x), #0()) -> #false() , #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #pos(@y)) -> #false() , #eq(#pos(@x), #0()) -> #false() , #eq(#pos(@x), #neg(@y)) -> #false() , #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y) , #eq(#s(@x), #0()) -> #false() , #eq(#s(@x), #s(@y)) -> #eq(@x, @y) , #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #eq(::(@x_1, @x_2), nil()) -> #false() , #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false() , #eq(nil(), ::(@y_1, @y_2)) -> #false() , #eq(nil(), nil()) -> #true() , #eq(nil(), tuple#2(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), nil()) -> #false() , #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #greater(@x, @y) -> #ckgt(#compare(@x, @y)) , #compare(#0(), #0()) -> #EQ() , #compare(#0(), #neg(@y)) -> #GT() , #compare(#0(), #pos(@y)) -> #LT() , #compare(#0(), #s(@y)) -> #LT() , #compare(#neg(@x), #0()) -> #LT() , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x) , #compare(#neg(@x), #pos(@y)) -> #LT() , #compare(#pos(@x), #0()) -> #GT() , #compare(#pos(@x), #neg(@y)) -> #GT() , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y) , #compare(#s(@x), #0()) -> #GT() , #compare(#s(@x), #s(@y)) -> #compare(@x, @y) , #ckgt(#EQ()) -> #false() , #ckgt(#GT()) -> #true() , #ckgt(#LT()) -> #false() , #less(@x, @y) -> #cklt(#compare(@x, @y)) , #cklt(#EQ()) -> #false() , #cklt(#GT()) -> #false() , #cklt(#LT()) -> #true() , *(@x, @y) -> #mult(@x, @y) , #mult(#0(), #0()) -> #0() , #mult(#0(), #neg(@y)) -> #0() , #mult(#0(), #pos(@y)) -> #0() , #mult(#neg(@x), #0()) -> #0() , #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y)) , #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #0()) -> #0() , #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y)) , +(@x, @y) -> #add(@x, @y) , #add(#0(), @y) -> @y , #add(#neg(#s(#0())), @y) -> #pred(@y) , #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y)) , #add(#pos(#s(#0())), @y) -> #succ(@y) , #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y)) , -(@x, @y) -> #sub(@x, @y) , #sub(@x, #0()) -> @x , #sub(@x, #neg(@y)) -> #add(@x, #pos(@y)) , #sub(@x, #pos(@y)) -> #add(@x, #neg(@y)) , add(@b1, @b2) -> add'(@b1, @b2, #abs(#0())) , add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r) , add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs) , add'#1(nil(), @b2, @r) -> nil() , add'#2(::(@y, @ys), @r, @x, @xs) -> add'#3(sum(@x, @y, @r), @xs, @ys) , add'#2(nil(), @r, @x, @xs) -> nil() , sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r)) , add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r')) , bitToInt(@b) -> bitToInt'(@b, #abs(#pos(#s(#0())))) , bitToInt'(@b, @n) -> bitToInt'#1(@b, @n) , bitToInt'#1(::(@x, @xs), @n) -> +(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))) , bitToInt'#1(nil(), @n) -> #abs(#0()) , compare(@b1, @b2) -> compare#1(@b1, @b2) , compare#1(::(@x, @xs), @b2) -> compare#2(@b2, @x, @xs) , compare#1(nil(), @b2) -> #abs(#0()) , compare#2(::(@y, @ys), @x, @xs) -> compare#3(compare(@xs, @ys), @x, @y) , compare#2(nil(), @x, @xs) -> #abs(#0()) , compare#3(@r, @x, @y) -> compare#4(#equal(@r, #0()), @r, @x, @y) , compare#4(#false(), @r, @x, @y) -> @r , compare#4(#true(), @r, @x, @y) -> compare#5(#less(@x, @y), @x, @y) , compare#5(#false(), @x, @y) -> compare#6(#greater(@x, @y)) , compare#5(#true(), @x, @y) -> -(#0(), #pos(#s(#0()))) , compare#6(#false()) -> #abs(#0()) , compare#6(#true()) -> #abs(#pos(#s(#0()))) , diff(@x, @y, @r) -> tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))), diff#1(#less(-(-(@x, @y), @r), #0()))) , mod(@x, @y) -> -(@x, *(@y, div(@x, @y))) , diff#1(#false()) -> #abs(#0()) , diff#1(#true()) -> #abs(#pos(#s(#0()))) , div(@x, @y) -> #div(@x, @y) , #div(#0(), #0()) -> #divByZero() , #div(#0(), #neg(@y)) -> #0() , #div(#0(), #pos(@y)) -> #0() , #div(#neg(@x), #0()) -> #divByZero() , #div(#neg(@x), #neg(@y)) -> #positive(#natdiv(@x, @y)) , #div(#neg(@x), #pos(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #0()) -> #divByZero() , #div(#pos(@x), #neg(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #pos(@y)) -> #positive(#natdiv(@x, @y)) , leq(@b1, @b2) -> #less(compare(@b1, @b2), #pos(#s(#0()))) , mult(@b1, @b2) -> mult#1(@b1, @b2) , mult#1(::(@x, @xs), @b2) -> mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x) , mult#1(nil(), @b2) -> nil() , mult#2(@zs, @b2, @x) -> mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs) , mult#3(#false(), @b2, @zs) -> @zs , mult#3(#true(), @b2, @zs) -> add(@b2, @zs) , mult3(@b1, @b2, @b3) -> mult(mult(@b1, @b2), @b2) , sub(@b1, @b2) -> sub#1(sub'(@b1, @b2, #abs(#0()))) , sub'(@b1, @b2, @r) -> sub'#1(@b1, @b2, @r) , sub#1(tuple#2(@b, @_@1)) -> @b , sub'#1(::(@x, @xs), @b2, @r) -> sub'#2(@b2, @r, @x, @xs) , sub'#1(nil(), @b2, @r) -> tuple#2(nil(), @r) , sub'#2(::(@y, @ys), @r, @x, @xs) -> sub'#3(diff(@x, @y, @r), @xs, @ys) , sub'#2(nil(), @r, @x, @xs) -> tuple#2(nil(), @r) , sub'#3(tuple#2(@z, @r'), @xs, @ys) -> sub'#4(sub'(@xs, @ys, @r'), @z) , sub'#4(tuple#2(@zs, @s), @z) -> tuple#2(sub'#5(#equal(@s, #pos(#s(#0()))), @z, @zs), @s) , sub'#5(#false(), @z, @zs) -> ::(@z, @zs) , sub'#5(#true(), @z, @zs) -> ::(#abs(#0()), @zs) , sum#1(@s) -> sum#2(#equal(@s, #0()), @s) , sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s) , sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0())) , sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0()))))) , sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0())) , sum#4(#false()) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0())))) , sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0())))) , #pred(#0()) -> #neg(#s(#0())) , #pred(#neg(#s(@x))) -> #neg(#s(#s(@x))) , #pred(#pos(#s(#0()))) -> #0() , #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x)) , #succ(#0()) -> #pos(#s(#0())) , #succ(#neg(#s(#0()))) -> #0() , #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x)) , #succ(#pos(#s(@x))) -> #pos(#s(#s(@x))) , #and(#false(), #false()) -> #false() , #and(#false(), #true()) -> #false() , #and(#true(), #false()) -> #false() , #and(#true(), #true()) -> #true() , #natdiv(#0(), #0()) -> #divByZero() , #natdiv(#0(), #s(@y)) -> #0() , #natdiv(#s(@x), #0()) -> #divByZero() , #natdiv(#s(@x), #s(@y)) -> #natdiv'(#divsub(@x, @y), #s(@y)) , #positive(#0()) -> #0() , #positive(#neg(@x)) -> #neg(@x) , #positive(#pos(@x)) -> #pos(@x) , #positive(#s(@x)) -> #pos(#s(@x)) , #negative(#0()) -> #0() , #negative(#neg(@x)) -> #pos(@x) , #negative(#pos(@x)) -> #neg(@x) , #negative(#s(@x)) -> #neg(#s(@x)) , #divsub(#0(), #0()) -> #0() , #divsub(#0(), #s(@y)) -> #underflow() , #divsub(#s(@x), #0()) -> #s(@x) , #divsub(#s(@x), #s(@y)) -> #divsub(@x, @y) , #natmult(#0(), @y) -> #0() , #natmult(#s(@x), @y) -> #natadd(@y, #natmult(@x, @y)) , #natadd(#0(), @y) -> @y , #natadd(#s(@x), @y) -> #s(#natadd(@x, @y)) , #natdiv'(#0(), @y) -> #s(#0()) , #natdiv'(#s(@x), @y) -> #s(#natdiv(#s(@x), @y)) , #natdiv'(#underflow(), @y) -> #0() , #natsub(@x, #0()) -> @x , #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^1)) The following weak DPs constitute a sub-graph of the DG that is closed under successors. The DPs are removed. { bitToInt^#(@b) -> c_6(bitToInt'^#(@b, #abs(#pos(#s(#0()))))) , bitToInt'^#(@b, @n) -> c_7(bitToInt'#1^#(@b, @n)) , bitToInt'#1^#(::(@x, @xs), @n) -> c_8(bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0())))))) } We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^1)). Strict DPs: { compare^#(@b1, @b2) -> c_9(compare#1^#(@b1, @b2)) , compare#1^#(::(@x, @xs), @b2) -> c_10(compare#2^#(@b2, @x, @xs)) , compare#2^#(::(@y, @ys), @x, @xs) -> c_11(compare^#(@xs, @ys)) , leq^#(@b1, @b2) -> c_12(compare^#(@b1, @b2)) , sub^#(@b1, @b2) -> c_18(sub'^#(@b1, @b2, #abs(#0()))) , sub'^#(@b1, @b2, @r) -> c_19(sub'#1^#(@b1, @b2, @r)) , sub'#1^#(::(@x, @xs), @b2, @r) -> c_20(sub'#2^#(@b2, @r, @x, @xs)) , sub'#2^#(::(@y, @ys), @r, @x, @xs) -> c_21(sub'#3^#(diff(@x, @y, @r), @xs, @ys)) , sub'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_22(sub'^#(@xs, @ys, @r')) } Weak Trs: { #abs(#0()) -> #0() , #abs(#neg(@x)) -> #pos(@x) , #abs(#pos(@x)) -> #pos(@x) , #abs(#s(@x)) -> #pos(#s(@x)) , #equal(@x, @y) -> #eq(@x, @y) , #eq(#0(), #0()) -> #true() , #eq(#0(), #neg(@y)) -> #false() , #eq(#0(), #pos(@y)) -> #false() , #eq(#0(), #s(@y)) -> #false() , #eq(#neg(@x), #0()) -> #false() , #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #pos(@y)) -> #false() , #eq(#pos(@x), #0()) -> #false() , #eq(#pos(@x), #neg(@y)) -> #false() , #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y) , #eq(#s(@x), #0()) -> #false() , #eq(#s(@x), #s(@y)) -> #eq(@x, @y) , #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #eq(::(@x_1, @x_2), nil()) -> #false() , #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false() , #eq(nil(), ::(@y_1, @y_2)) -> #false() , #eq(nil(), nil()) -> #true() , #eq(nil(), tuple#2(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), nil()) -> #false() , #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #greater(@x, @y) -> #ckgt(#compare(@x, @y)) , #compare(#0(), #0()) -> #EQ() , #compare(#0(), #neg(@y)) -> #GT() , #compare(#0(), #pos(@y)) -> #LT() , #compare(#0(), #s(@y)) -> #LT() , #compare(#neg(@x), #0()) -> #LT() , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x) , #compare(#neg(@x), #pos(@y)) -> #LT() , #compare(#pos(@x), #0()) -> #GT() , #compare(#pos(@x), #neg(@y)) -> #GT() , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y) , #compare(#s(@x), #0()) -> #GT() , #compare(#s(@x), #s(@y)) -> #compare(@x, @y) , #ckgt(#EQ()) -> #false() , #ckgt(#GT()) -> #true() , #ckgt(#LT()) -> #false() , #less(@x, @y) -> #cklt(#compare(@x, @y)) , #cklt(#EQ()) -> #false() , #cklt(#GT()) -> #false() , #cklt(#LT()) -> #true() , *(@x, @y) -> #mult(@x, @y) , #mult(#0(), #0()) -> #0() , #mult(#0(), #neg(@y)) -> #0() , #mult(#0(), #pos(@y)) -> #0() , #mult(#neg(@x), #0()) -> #0() , #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y)) , #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #0()) -> #0() , #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y)) , +(@x, @y) -> #add(@x, @y) , #add(#0(), @y) -> @y , #add(#neg(#s(#0())), @y) -> #pred(@y) , #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y)) , #add(#pos(#s(#0())), @y) -> #succ(@y) , #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y)) , -(@x, @y) -> #sub(@x, @y) , #sub(@x, #0()) -> @x , #sub(@x, #neg(@y)) -> #add(@x, #pos(@y)) , #sub(@x, #pos(@y)) -> #add(@x, #neg(@y)) , add(@b1, @b2) -> add'(@b1, @b2, #abs(#0())) , add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r) , add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs) , add'#1(nil(), @b2, @r) -> nil() , add'#2(::(@y, @ys), @r, @x, @xs) -> add'#3(sum(@x, @y, @r), @xs, @ys) , add'#2(nil(), @r, @x, @xs) -> nil() , sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r)) , add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r')) , bitToInt(@b) -> bitToInt'(@b, #abs(#pos(#s(#0())))) , bitToInt'(@b, @n) -> bitToInt'#1(@b, @n) , bitToInt'#1(::(@x, @xs), @n) -> +(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))) , bitToInt'#1(nil(), @n) -> #abs(#0()) , compare(@b1, @b2) -> compare#1(@b1, @b2) , compare#1(::(@x, @xs), @b2) -> compare#2(@b2, @x, @xs) , compare#1(nil(), @b2) -> #abs(#0()) , compare#2(::(@y, @ys), @x, @xs) -> compare#3(compare(@xs, @ys), @x, @y) , compare#2(nil(), @x, @xs) -> #abs(#0()) , compare#3(@r, @x, @y) -> compare#4(#equal(@r, #0()), @r, @x, @y) , compare#4(#false(), @r, @x, @y) -> @r , compare#4(#true(), @r, @x, @y) -> compare#5(#less(@x, @y), @x, @y) , compare#5(#false(), @x, @y) -> compare#6(#greater(@x, @y)) , compare#5(#true(), @x, @y) -> -(#0(), #pos(#s(#0()))) , compare#6(#false()) -> #abs(#0()) , compare#6(#true()) -> #abs(#pos(#s(#0()))) , diff(@x, @y, @r) -> tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))), diff#1(#less(-(-(@x, @y), @r), #0()))) , mod(@x, @y) -> -(@x, *(@y, div(@x, @y))) , diff#1(#false()) -> #abs(#0()) , diff#1(#true()) -> #abs(#pos(#s(#0()))) , div(@x, @y) -> #div(@x, @y) , #div(#0(), #0()) -> #divByZero() , #div(#0(), #neg(@y)) -> #0() , #div(#0(), #pos(@y)) -> #0() , #div(#neg(@x), #0()) -> #divByZero() , #div(#neg(@x), #neg(@y)) -> #positive(#natdiv(@x, @y)) , #div(#neg(@x), #pos(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #0()) -> #divByZero() , #div(#pos(@x), #neg(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #pos(@y)) -> #positive(#natdiv(@x, @y)) , leq(@b1, @b2) -> #less(compare(@b1, @b2), #pos(#s(#0()))) , mult(@b1, @b2) -> mult#1(@b1, @b2) , mult#1(::(@x, @xs), @b2) -> mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x) , mult#1(nil(), @b2) -> nil() , mult#2(@zs, @b2, @x) -> mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs) , mult#3(#false(), @b2, @zs) -> @zs , mult#3(#true(), @b2, @zs) -> add(@b2, @zs) , mult3(@b1, @b2, @b3) -> mult(mult(@b1, @b2), @b2) , sub(@b1, @b2) -> sub#1(sub'(@b1, @b2, #abs(#0()))) , sub'(@b1, @b2, @r) -> sub'#1(@b1, @b2, @r) , sub#1(tuple#2(@b, @_@1)) -> @b , sub'#1(::(@x, @xs), @b2, @r) -> sub'#2(@b2, @r, @x, @xs) , sub'#1(nil(), @b2, @r) -> tuple#2(nil(), @r) , sub'#2(::(@y, @ys), @r, @x, @xs) -> sub'#3(diff(@x, @y, @r), @xs, @ys) , sub'#2(nil(), @r, @x, @xs) -> tuple#2(nil(), @r) , sub'#3(tuple#2(@z, @r'), @xs, @ys) -> sub'#4(sub'(@xs, @ys, @r'), @z) , sub'#4(tuple#2(@zs, @s), @z) -> tuple#2(sub'#5(#equal(@s, #pos(#s(#0()))), @z, @zs), @s) , sub'#5(#false(), @z, @zs) -> ::(@z, @zs) , sub'#5(#true(), @z, @zs) -> ::(#abs(#0()), @zs) , sum#1(@s) -> sum#2(#equal(@s, #0()), @s) , sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s) , sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0())) , sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0()))))) , sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0())) , sum#4(#false()) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0())))) , sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0())))) , #pred(#0()) -> #neg(#s(#0())) , #pred(#neg(#s(@x))) -> #neg(#s(#s(@x))) , #pred(#pos(#s(#0()))) -> #0() , #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x)) , #succ(#0()) -> #pos(#s(#0())) , #succ(#neg(#s(#0()))) -> #0() , #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x)) , #succ(#pos(#s(@x))) -> #pos(#s(#s(@x))) , #and(#false(), #false()) -> #false() , #and(#false(), #true()) -> #false() , #and(#true(), #false()) -> #false() , #and(#true(), #true()) -> #true() , #natdiv(#0(), #0()) -> #divByZero() , #natdiv(#0(), #s(@y)) -> #0() , #natdiv(#s(@x), #0()) -> #divByZero() , #natdiv(#s(@x), #s(@y)) -> #natdiv'(#divsub(@x, @y), #s(@y)) , #positive(#0()) -> #0() , #positive(#neg(@x)) -> #neg(@x) , #positive(#pos(@x)) -> #pos(@x) , #positive(#s(@x)) -> #pos(#s(@x)) , #negative(#0()) -> #0() , #negative(#neg(@x)) -> #pos(@x) , #negative(#pos(@x)) -> #neg(@x) , #negative(#s(@x)) -> #neg(#s(@x)) , #divsub(#0(), #0()) -> #0() , #divsub(#0(), #s(@y)) -> #underflow() , #divsub(#s(@x), #0()) -> #s(@x) , #divsub(#s(@x), #s(@y)) -> #divsub(@x, @y) , #natmult(#0(), @y) -> #0() , #natmult(#s(@x), @y) -> #natadd(@y, #natmult(@x, @y)) , #natadd(#0(), @y) -> @y , #natadd(#s(@x), @y) -> #s(#natadd(@x, @y)) , #natdiv'(#0(), @y) -> #s(#0()) , #natdiv'(#s(@x), @y) -> #s(#natdiv(#s(@x), @y)) , #natdiv'(#underflow(), @y) -> #0() , #natsub(@x, #0()) -> @x , #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^1)) We analyse the complexity of following sub-problems (R) and (S). Problem (S) is obtained from the input problem by shifting strict rules from (R) into the weak component: Problem (R): ------------ Strict DPs: { compare^#(@b1, @b2) -> c_9(compare#1^#(@b1, @b2)) , compare#1^#(::(@x, @xs), @b2) -> c_10(compare#2^#(@b2, @x, @xs)) , compare#2^#(::(@y, @ys), @x, @xs) -> c_11(compare^#(@xs, @ys)) , leq^#(@b1, @b2) -> c_12(compare^#(@b1, @b2)) } Weak DPs: { sub^#(@b1, @b2) -> c_18(sub'^#(@b1, @b2, #abs(#0()))) , sub'^#(@b1, @b2, @r) -> c_19(sub'#1^#(@b1, @b2, @r)) , sub'#1^#(::(@x, @xs), @b2, @r) -> c_20(sub'#2^#(@b2, @r, @x, @xs)) , sub'#2^#(::(@y, @ys), @r, @x, @xs) -> c_21(sub'#3^#(diff(@x, @y, @r), @xs, @ys)) , sub'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_22(sub'^#(@xs, @ys, @r')) } Weak Trs: { #abs(#0()) -> #0() , #abs(#neg(@x)) -> #pos(@x) , #abs(#pos(@x)) -> #pos(@x) , #abs(#s(@x)) -> #pos(#s(@x)) , #equal(@x, @y) -> #eq(@x, @y) , #eq(#0(), #0()) -> #true() , #eq(#0(), #neg(@y)) -> #false() , #eq(#0(), #pos(@y)) -> #false() , #eq(#0(), #s(@y)) -> #false() , #eq(#neg(@x), #0()) -> #false() , #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #pos(@y)) -> #false() , #eq(#pos(@x), #0()) -> #false() , #eq(#pos(@x), #neg(@y)) -> #false() , #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y) , #eq(#s(@x), #0()) -> #false() , #eq(#s(@x), #s(@y)) -> #eq(@x, @y) , #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #eq(::(@x_1, @x_2), nil()) -> #false() , #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false() , #eq(nil(), ::(@y_1, @y_2)) -> #false() , #eq(nil(), nil()) -> #true() , #eq(nil(), tuple#2(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), nil()) -> #false() , #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #greater(@x, @y) -> #ckgt(#compare(@x, @y)) , #compare(#0(), #0()) -> #EQ() , #compare(#0(), #neg(@y)) -> #GT() , #compare(#0(), #pos(@y)) -> #LT() , #compare(#0(), #s(@y)) -> #LT() , #compare(#neg(@x), #0()) -> #LT() , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x) , #compare(#neg(@x), #pos(@y)) -> #LT() , #compare(#pos(@x), #0()) -> #GT() , #compare(#pos(@x), #neg(@y)) -> #GT() , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y) , #compare(#s(@x), #0()) -> #GT() , #compare(#s(@x), #s(@y)) -> #compare(@x, @y) , #ckgt(#EQ()) -> #false() , #ckgt(#GT()) -> #true() , #ckgt(#LT()) -> #false() , #less(@x, @y) -> #cklt(#compare(@x, @y)) , #cklt(#EQ()) -> #false() , #cklt(#GT()) -> #false() , #cklt(#LT()) -> #true() , *(@x, @y) -> #mult(@x, @y) , #mult(#0(), #0()) -> #0() , #mult(#0(), #neg(@y)) -> #0() , #mult(#0(), #pos(@y)) -> #0() , #mult(#neg(@x), #0()) -> #0() , #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y)) , #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #0()) -> #0() , #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y)) , +(@x, @y) -> #add(@x, @y) , #add(#0(), @y) -> @y , #add(#neg(#s(#0())), @y) -> #pred(@y) , #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y)) , #add(#pos(#s(#0())), @y) -> #succ(@y) , #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y)) , -(@x, @y) -> #sub(@x, @y) , #sub(@x, #0()) -> @x , #sub(@x, #neg(@y)) -> #add(@x, #pos(@y)) , #sub(@x, #pos(@y)) -> #add(@x, #neg(@y)) , add(@b1, @b2) -> add'(@b1, @b2, #abs(#0())) , add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r) , add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs) , add'#1(nil(), @b2, @r) -> nil() , add'#2(::(@y, @ys), @r, @x, @xs) -> add'#3(sum(@x, @y, @r), @xs, @ys) , add'#2(nil(), @r, @x, @xs) -> nil() , sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r)) , add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r')) , bitToInt(@b) -> bitToInt'(@b, #abs(#pos(#s(#0())))) , bitToInt'(@b, @n) -> bitToInt'#1(@b, @n) , bitToInt'#1(::(@x, @xs), @n) -> +(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))) , bitToInt'#1(nil(), @n) -> #abs(#0()) , compare(@b1, @b2) -> compare#1(@b1, @b2) , compare#1(::(@x, @xs), @b2) -> compare#2(@b2, @x, @xs) , compare#1(nil(), @b2) -> #abs(#0()) , compare#2(::(@y, @ys), @x, @xs) -> compare#3(compare(@xs, @ys), @x, @y) , compare#2(nil(), @x, @xs) -> #abs(#0()) , compare#3(@r, @x, @y) -> compare#4(#equal(@r, #0()), @r, @x, @y) , compare#4(#false(), @r, @x, @y) -> @r , compare#4(#true(), @r, @x, @y) -> compare#5(#less(@x, @y), @x, @y) , compare#5(#false(), @x, @y) -> compare#6(#greater(@x, @y)) , compare#5(#true(), @x, @y) -> -(#0(), #pos(#s(#0()))) , compare#6(#false()) -> #abs(#0()) , compare#6(#true()) -> #abs(#pos(#s(#0()))) , diff(@x, @y, @r) -> tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))), diff#1(#less(-(-(@x, @y), @r), #0()))) , mod(@x, @y) -> -(@x, *(@y, div(@x, @y))) , diff#1(#false()) -> #abs(#0()) , diff#1(#true()) -> #abs(#pos(#s(#0()))) , div(@x, @y) -> #div(@x, @y) , #div(#0(), #0()) -> #divByZero() , #div(#0(), #neg(@y)) -> #0() , #div(#0(), #pos(@y)) -> #0() , #div(#neg(@x), #0()) -> #divByZero() , #div(#neg(@x), #neg(@y)) -> #positive(#natdiv(@x, @y)) , #div(#neg(@x), #pos(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #0()) -> #divByZero() , #div(#pos(@x), #neg(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #pos(@y)) -> #positive(#natdiv(@x, @y)) , leq(@b1, @b2) -> #less(compare(@b1, @b2), #pos(#s(#0()))) , mult(@b1, @b2) -> mult#1(@b1, @b2) , mult#1(::(@x, @xs), @b2) -> mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x) , mult#1(nil(), @b2) -> nil() , mult#2(@zs, @b2, @x) -> mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs) , mult#3(#false(), @b2, @zs) -> @zs , mult#3(#true(), @b2, @zs) -> add(@b2, @zs) , mult3(@b1, @b2, @b3) -> mult(mult(@b1, @b2), @b2) , sub(@b1, @b2) -> sub#1(sub'(@b1, @b2, #abs(#0()))) , sub'(@b1, @b2, @r) -> sub'#1(@b1, @b2, @r) , sub#1(tuple#2(@b, @_@1)) -> @b , sub'#1(::(@x, @xs), @b2, @r) -> sub'#2(@b2, @r, @x, @xs) , sub'#1(nil(), @b2, @r) -> tuple#2(nil(), @r) , sub'#2(::(@y, @ys), @r, @x, @xs) -> sub'#3(diff(@x, @y, @r), @xs, @ys) , sub'#2(nil(), @r, @x, @xs) -> tuple#2(nil(), @r) , sub'#3(tuple#2(@z, @r'), @xs, @ys) -> sub'#4(sub'(@xs, @ys, @r'), @z) , sub'#4(tuple#2(@zs, @s), @z) -> tuple#2(sub'#5(#equal(@s, #pos(#s(#0()))), @z, @zs), @s) , sub'#5(#false(), @z, @zs) -> ::(@z, @zs) , sub'#5(#true(), @z, @zs) -> ::(#abs(#0()), @zs) , sum#1(@s) -> sum#2(#equal(@s, #0()), @s) , sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s) , sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0())) , sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0()))))) , sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0())) , sum#4(#false()) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0())))) , sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0())))) , #pred(#0()) -> #neg(#s(#0())) , #pred(#neg(#s(@x))) -> #neg(#s(#s(@x))) , #pred(#pos(#s(#0()))) -> #0() , #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x)) , #succ(#0()) -> #pos(#s(#0())) , #succ(#neg(#s(#0()))) -> #0() , #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x)) , #succ(#pos(#s(@x))) -> #pos(#s(#s(@x))) , #and(#false(), #false()) -> #false() , #and(#false(), #true()) -> #false() , #and(#true(), #false()) -> #false() , #and(#true(), #true()) -> #true() , #natdiv(#0(), #0()) -> #divByZero() , #natdiv(#0(), #s(@y)) -> #0() , #natdiv(#s(@x), #0()) -> #divByZero() , #natdiv(#s(@x), #s(@y)) -> #natdiv'(#divsub(@x, @y), #s(@y)) , #positive(#0()) -> #0() , #positive(#neg(@x)) -> #neg(@x) , #positive(#pos(@x)) -> #pos(@x) , #positive(#s(@x)) -> #pos(#s(@x)) , #negative(#0()) -> #0() , #negative(#neg(@x)) -> #pos(@x) , #negative(#pos(@x)) -> #neg(@x) , #negative(#s(@x)) -> #neg(#s(@x)) , #divsub(#0(), #0()) -> #0() , #divsub(#0(), #s(@y)) -> #underflow() , #divsub(#s(@x), #0()) -> #s(@x) , #divsub(#s(@x), #s(@y)) -> #divsub(@x, @y) , #natmult(#0(), @y) -> #0() , #natmult(#s(@x), @y) -> #natadd(@y, #natmult(@x, @y)) , #natadd(#0(), @y) -> @y , #natadd(#s(@x), @y) -> #s(#natadd(@x, @y)) , #natdiv'(#0(), @y) -> #s(#0()) , #natdiv'(#s(@x), @y) -> #s(#natdiv(#s(@x), @y)) , #natdiv'(#underflow(), @y) -> #0() , #natsub(@x, #0()) -> @x , #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) } StartTerms: basic terms Strategy: innermost Problem (S): ------------ Strict DPs: { sub^#(@b1, @b2) -> c_18(sub'^#(@b1, @b2, #abs(#0()))) , sub'^#(@b1, @b2, @r) -> c_19(sub'#1^#(@b1, @b2, @r)) , sub'#1^#(::(@x, @xs), @b2, @r) -> c_20(sub'#2^#(@b2, @r, @x, @xs)) , sub'#2^#(::(@y, @ys), @r, @x, @xs) -> c_21(sub'#3^#(diff(@x, @y, @r), @xs, @ys)) , sub'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_22(sub'^#(@xs, @ys, @r')) } Weak DPs: { compare^#(@b1, @b2) -> c_9(compare#1^#(@b1, @b2)) , compare#1^#(::(@x, @xs), @b2) -> c_10(compare#2^#(@b2, @x, @xs)) , compare#2^#(::(@y, @ys), @x, @xs) -> c_11(compare^#(@xs, @ys)) , leq^#(@b1, @b2) -> c_12(compare^#(@b1, @b2)) } Weak Trs: { #abs(#0()) -> #0() , #abs(#neg(@x)) -> #pos(@x) , #abs(#pos(@x)) -> #pos(@x) , #abs(#s(@x)) -> #pos(#s(@x)) , #equal(@x, @y) -> #eq(@x, @y) , #eq(#0(), #0()) -> #true() , #eq(#0(), #neg(@y)) -> #false() , #eq(#0(), #pos(@y)) -> #false() , #eq(#0(), #s(@y)) -> #false() , #eq(#neg(@x), #0()) -> #false() , #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #pos(@y)) -> #false() , #eq(#pos(@x), #0()) -> #false() , #eq(#pos(@x), #neg(@y)) -> #false() , #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y) , #eq(#s(@x), #0()) -> #false() , #eq(#s(@x), #s(@y)) -> #eq(@x, @y) , #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #eq(::(@x_1, @x_2), nil()) -> #false() , #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false() , #eq(nil(), ::(@y_1, @y_2)) -> #false() , #eq(nil(), nil()) -> #true() , #eq(nil(), tuple#2(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), nil()) -> #false() , #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #greater(@x, @y) -> #ckgt(#compare(@x, @y)) , #compare(#0(), #0()) -> #EQ() , #compare(#0(), #neg(@y)) -> #GT() , #compare(#0(), #pos(@y)) -> #LT() , #compare(#0(), #s(@y)) -> #LT() , #compare(#neg(@x), #0()) -> #LT() , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x) , #compare(#neg(@x), #pos(@y)) -> #LT() , #compare(#pos(@x), #0()) -> #GT() , #compare(#pos(@x), #neg(@y)) -> #GT() , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y) , #compare(#s(@x), #0()) -> #GT() , #compare(#s(@x), #s(@y)) -> #compare(@x, @y) , #ckgt(#EQ()) -> #false() , #ckgt(#GT()) -> #true() , #ckgt(#LT()) -> #false() , #less(@x, @y) -> #cklt(#compare(@x, @y)) , #cklt(#EQ()) -> #false() , #cklt(#GT()) -> #false() , #cklt(#LT()) -> #true() , *(@x, @y) -> #mult(@x, @y) , #mult(#0(), #0()) -> #0() , #mult(#0(), #neg(@y)) -> #0() , #mult(#0(), #pos(@y)) -> #0() , #mult(#neg(@x), #0()) -> #0() , #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y)) , #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #0()) -> #0() , #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y)) , +(@x, @y) -> #add(@x, @y) , #add(#0(), @y) -> @y , #add(#neg(#s(#0())), @y) -> #pred(@y) , #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y)) , #add(#pos(#s(#0())), @y) -> #succ(@y) , #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y)) , -(@x, @y) -> #sub(@x, @y) , #sub(@x, #0()) -> @x , #sub(@x, #neg(@y)) -> #add(@x, #pos(@y)) , #sub(@x, #pos(@y)) -> #add(@x, #neg(@y)) , add(@b1, @b2) -> add'(@b1, @b2, #abs(#0())) , add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r) , add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs) , add'#1(nil(), @b2, @r) -> nil() , add'#2(::(@y, @ys), @r, @x, @xs) -> add'#3(sum(@x, @y, @r), @xs, @ys) , add'#2(nil(), @r, @x, @xs) -> nil() , sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r)) , add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r')) , bitToInt(@b) -> bitToInt'(@b, #abs(#pos(#s(#0())))) , bitToInt'(@b, @n) -> bitToInt'#1(@b, @n) , bitToInt'#1(::(@x, @xs), @n) -> +(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))) , bitToInt'#1(nil(), @n) -> #abs(#0()) , compare(@b1, @b2) -> compare#1(@b1, @b2) , compare#1(::(@x, @xs), @b2) -> compare#2(@b2, @x, @xs) , compare#1(nil(), @b2) -> #abs(#0()) , compare#2(::(@y, @ys), @x, @xs) -> compare#3(compare(@xs, @ys), @x, @y) , compare#2(nil(), @x, @xs) -> #abs(#0()) , compare#3(@r, @x, @y) -> compare#4(#equal(@r, #0()), @r, @x, @y) , compare#4(#false(), @r, @x, @y) -> @r , compare#4(#true(), @r, @x, @y) -> compare#5(#less(@x, @y), @x, @y) , compare#5(#false(), @x, @y) -> compare#6(#greater(@x, @y)) , compare#5(#true(), @x, @y) -> -(#0(), #pos(#s(#0()))) , compare#6(#false()) -> #abs(#0()) , compare#6(#true()) -> #abs(#pos(#s(#0()))) , diff(@x, @y, @r) -> tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))), diff#1(#less(-(-(@x, @y), @r), #0()))) , mod(@x, @y) -> -(@x, *(@y, div(@x, @y))) , diff#1(#false()) -> #abs(#0()) , diff#1(#true()) -> #abs(#pos(#s(#0()))) , div(@x, @y) -> #div(@x, @y) , #div(#0(), #0()) -> #divByZero() , #div(#0(), #neg(@y)) -> #0() , #div(#0(), #pos(@y)) -> #0() , #div(#neg(@x), #0()) -> #divByZero() , #div(#neg(@x), #neg(@y)) -> #positive(#natdiv(@x, @y)) , #div(#neg(@x), #pos(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #0()) -> #divByZero() , #div(#pos(@x), #neg(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #pos(@y)) -> #positive(#natdiv(@x, @y)) , leq(@b1, @b2) -> #less(compare(@b1, @b2), #pos(#s(#0()))) , mult(@b1, @b2) -> mult#1(@b1, @b2) , mult#1(::(@x, @xs), @b2) -> mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x) , mult#1(nil(), @b2) -> nil() , mult#2(@zs, @b2, @x) -> mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs) , mult#3(#false(), @b2, @zs) -> @zs , mult#3(#true(), @b2, @zs) -> add(@b2, @zs) , mult3(@b1, @b2, @b3) -> mult(mult(@b1, @b2), @b2) , sub(@b1, @b2) -> sub#1(sub'(@b1, @b2, #abs(#0()))) , sub'(@b1, @b2, @r) -> sub'#1(@b1, @b2, @r) , sub#1(tuple#2(@b, @_@1)) -> @b , sub'#1(::(@x, @xs), @b2, @r) -> sub'#2(@b2, @r, @x, @xs) , sub'#1(nil(), @b2, @r) -> tuple#2(nil(), @r) , sub'#2(::(@y, @ys), @r, @x, @xs) -> sub'#3(diff(@x, @y, @r), @xs, @ys) , sub'#2(nil(), @r, @x, @xs) -> tuple#2(nil(), @r) , sub'#3(tuple#2(@z, @r'), @xs, @ys) -> sub'#4(sub'(@xs, @ys, @r'), @z) , sub'#4(tuple#2(@zs, @s), @z) -> tuple#2(sub'#5(#equal(@s, #pos(#s(#0()))), @z, @zs), @s) , sub'#5(#false(), @z, @zs) -> ::(@z, @zs) , sub'#5(#true(), @z, @zs) -> ::(#abs(#0()), @zs) , sum#1(@s) -> sum#2(#equal(@s, #0()), @s) , sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s) , sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0())) , sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0()))))) , sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0())) , sum#4(#false()) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0())))) , sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0())))) , #pred(#0()) -> #neg(#s(#0())) , #pred(#neg(#s(@x))) -> #neg(#s(#s(@x))) , #pred(#pos(#s(#0()))) -> #0() , #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x)) , #succ(#0()) -> #pos(#s(#0())) , #succ(#neg(#s(#0()))) -> #0() , #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x)) , #succ(#pos(#s(@x))) -> #pos(#s(#s(@x))) , #and(#false(), #false()) -> #false() , #and(#false(), #true()) -> #false() , #and(#true(), #false()) -> #false() , #and(#true(), #true()) -> #true() , #natdiv(#0(), #0()) -> #divByZero() , #natdiv(#0(), #s(@y)) -> #0() , #natdiv(#s(@x), #0()) -> #divByZero() , #natdiv(#s(@x), #s(@y)) -> #natdiv'(#divsub(@x, @y), #s(@y)) , #positive(#0()) -> #0() , #positive(#neg(@x)) -> #neg(@x) , #positive(#pos(@x)) -> #pos(@x) , #positive(#s(@x)) -> #pos(#s(@x)) , #negative(#0()) -> #0() , #negative(#neg(@x)) -> #pos(@x) , #negative(#pos(@x)) -> #neg(@x) , #negative(#s(@x)) -> #neg(#s(@x)) , #divsub(#0(), #0()) -> #0() , #divsub(#0(), #s(@y)) -> #underflow() , #divsub(#s(@x), #0()) -> #s(@x) , #divsub(#s(@x), #s(@y)) -> #divsub(@x, @y) , #natmult(#0(), @y) -> #0() , #natmult(#s(@x), @y) -> #natadd(@y, #natmult(@x, @y)) , #natadd(#0(), @y) -> @y , #natadd(#s(@x), @y) -> #s(#natadd(@x, @y)) , #natdiv'(#0(), @y) -> #s(#0()) , #natdiv'(#s(@x), @y) -> #s(#natdiv(#s(@x), @y)) , #natdiv'(#underflow(), @y) -> #0() , #natsub(@x, #0()) -> @x , #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) } StartTerms: basic terms Strategy: innermost Overall, the transformation results in the following sub-problem(s): Generated new problems: ----------------------- R) Strict DPs: { compare^#(@b1, @b2) -> c_9(compare#1^#(@b1, @b2)) , compare#1^#(::(@x, @xs), @b2) -> c_10(compare#2^#(@b2, @x, @xs)) , compare#2^#(::(@y, @ys), @x, @xs) -> c_11(compare^#(@xs, @ys)) , leq^#(@b1, @b2) -> c_12(compare^#(@b1, @b2)) } Weak DPs: { sub^#(@b1, @b2) -> c_18(sub'^#(@b1, @b2, #abs(#0()))) , sub'^#(@b1, @b2, @r) -> c_19(sub'#1^#(@b1, @b2, @r)) , sub'#1^#(::(@x, @xs), @b2, @r) -> c_20(sub'#2^#(@b2, @r, @x, @xs)) , sub'#2^#(::(@y, @ys), @r, @x, @xs) -> c_21(sub'#3^#(diff(@x, @y, @r), @xs, @ys)) , sub'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_22(sub'^#(@xs, @ys, @r')) } Weak Trs: { #abs(#0()) -> #0() , #abs(#neg(@x)) -> #pos(@x) , #abs(#pos(@x)) -> #pos(@x) , #abs(#s(@x)) -> #pos(#s(@x)) , #equal(@x, @y) -> #eq(@x, @y) , #eq(#0(), #0()) -> #true() , #eq(#0(), #neg(@y)) -> #false() , #eq(#0(), #pos(@y)) -> #false() , #eq(#0(), #s(@y)) -> #false() , #eq(#neg(@x), #0()) -> #false() , #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #pos(@y)) -> #false() , #eq(#pos(@x), #0()) -> #false() , #eq(#pos(@x), #neg(@y)) -> #false() , #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y) , #eq(#s(@x), #0()) -> #false() , #eq(#s(@x), #s(@y)) -> #eq(@x, @y) , #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #eq(::(@x_1, @x_2), nil()) -> #false() , #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false() , #eq(nil(), ::(@y_1, @y_2)) -> #false() , #eq(nil(), nil()) -> #true() , #eq(nil(), tuple#2(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), nil()) -> #false() , #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #greater(@x, @y) -> #ckgt(#compare(@x, @y)) , #compare(#0(), #0()) -> #EQ() , #compare(#0(), #neg(@y)) -> #GT() , #compare(#0(), #pos(@y)) -> #LT() , #compare(#0(), #s(@y)) -> #LT() , #compare(#neg(@x), #0()) -> #LT() , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x) , #compare(#neg(@x), #pos(@y)) -> #LT() , #compare(#pos(@x), #0()) -> #GT() , #compare(#pos(@x), #neg(@y)) -> #GT() , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y) , #compare(#s(@x), #0()) -> #GT() , #compare(#s(@x), #s(@y)) -> #compare(@x, @y) , #ckgt(#EQ()) -> #false() , #ckgt(#GT()) -> #true() , #ckgt(#LT()) -> #false() , #less(@x, @y) -> #cklt(#compare(@x, @y)) , #cklt(#EQ()) -> #false() , #cklt(#GT()) -> #false() , #cklt(#LT()) -> #true() , *(@x, @y) -> #mult(@x, @y) , #mult(#0(), #0()) -> #0() , #mult(#0(), #neg(@y)) -> #0() , #mult(#0(), #pos(@y)) -> #0() , #mult(#neg(@x), #0()) -> #0() , #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y)) , #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #0()) -> #0() , #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y)) , +(@x, @y) -> #add(@x, @y) , #add(#0(), @y) -> @y , #add(#neg(#s(#0())), @y) -> #pred(@y) , #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y)) , #add(#pos(#s(#0())), @y) -> #succ(@y) , #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y)) , -(@x, @y) -> #sub(@x, @y) , #sub(@x, #0()) -> @x , #sub(@x, #neg(@y)) -> #add(@x, #pos(@y)) , #sub(@x, #pos(@y)) -> #add(@x, #neg(@y)) , add(@b1, @b2) -> add'(@b1, @b2, #abs(#0())) , add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r) , add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs) , add'#1(nil(), @b2, @r) -> nil() , add'#2(::(@y, @ys), @r, @x, @xs) -> add'#3(sum(@x, @y, @r), @xs, @ys) , add'#2(nil(), @r, @x, @xs) -> nil() , sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r)) , add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r')) , bitToInt(@b) -> bitToInt'(@b, #abs(#pos(#s(#0())))) , bitToInt'(@b, @n) -> bitToInt'#1(@b, @n) , bitToInt'#1(::(@x, @xs), @n) -> +(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))) , bitToInt'#1(nil(), @n) -> #abs(#0()) , compare(@b1, @b2) -> compare#1(@b1, @b2) , compare#1(::(@x, @xs), @b2) -> compare#2(@b2, @x, @xs) , compare#1(nil(), @b2) -> #abs(#0()) , compare#2(::(@y, @ys), @x, @xs) -> compare#3(compare(@xs, @ys), @x, @y) , compare#2(nil(), @x, @xs) -> #abs(#0()) , compare#3(@r, @x, @y) -> compare#4(#equal(@r, #0()), @r, @x, @y) , compare#4(#false(), @r, @x, @y) -> @r , compare#4(#true(), @r, @x, @y) -> compare#5(#less(@x, @y), @x, @y) , compare#5(#false(), @x, @y) -> compare#6(#greater(@x, @y)) , compare#5(#true(), @x, @y) -> -(#0(), #pos(#s(#0()))) , compare#6(#false()) -> #abs(#0()) , compare#6(#true()) -> #abs(#pos(#s(#0()))) , diff(@x, @y, @r) -> tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))), diff#1(#less(-(-(@x, @y), @r), #0()))) , mod(@x, @y) -> -(@x, *(@y, div(@x, @y))) , diff#1(#false()) -> #abs(#0()) , diff#1(#true()) -> #abs(#pos(#s(#0()))) , div(@x, @y) -> #div(@x, @y) , #div(#0(), #0()) -> #divByZero() , #div(#0(), #neg(@y)) -> #0() , #div(#0(), #pos(@y)) -> #0() , #div(#neg(@x), #0()) -> #divByZero() , #div(#neg(@x), #neg(@y)) -> #positive(#natdiv(@x, @y)) , #div(#neg(@x), #pos(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #0()) -> #divByZero() , #div(#pos(@x), #neg(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #pos(@y)) -> #positive(#natdiv(@x, @y)) , leq(@b1, @b2) -> #less(compare(@b1, @b2), #pos(#s(#0()))) , mult(@b1, @b2) -> mult#1(@b1, @b2) , mult#1(::(@x, @xs), @b2) -> mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x) , mult#1(nil(), @b2) -> nil() , mult#2(@zs, @b2, @x) -> mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs) , mult#3(#false(), @b2, @zs) -> @zs , mult#3(#true(), @b2, @zs) -> add(@b2, @zs) , mult3(@b1, @b2, @b3) -> mult(mult(@b1, @b2), @b2) , sub(@b1, @b2) -> sub#1(sub'(@b1, @b2, #abs(#0()))) , sub'(@b1, @b2, @r) -> sub'#1(@b1, @b2, @r) , sub#1(tuple#2(@b, @_@1)) -> @b , sub'#1(::(@x, @xs), @b2, @r) -> sub'#2(@b2, @r, @x, @xs) , sub'#1(nil(), @b2, @r) -> tuple#2(nil(), @r) , sub'#2(::(@y, @ys), @r, @x, @xs) -> sub'#3(diff(@x, @y, @r), @xs, @ys) , sub'#2(nil(), @r, @x, @xs) -> tuple#2(nil(), @r) , sub'#3(tuple#2(@z, @r'), @xs, @ys) -> sub'#4(sub'(@xs, @ys, @r'), @z) , sub'#4(tuple#2(@zs, @s), @z) -> tuple#2(sub'#5(#equal(@s, #pos(#s(#0()))), @z, @zs), @s) , sub'#5(#false(), @z, @zs) -> ::(@z, @zs) , sub'#5(#true(), @z, @zs) -> ::(#abs(#0()), @zs) , sum#1(@s) -> sum#2(#equal(@s, #0()), @s) , sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s) , sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0())) , sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0()))))) , sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0())) , sum#4(#false()) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0())))) , sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0())))) , #pred(#0()) -> #neg(#s(#0())) , #pred(#neg(#s(@x))) -> #neg(#s(#s(@x))) , #pred(#pos(#s(#0()))) -> #0() , #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x)) , #succ(#0()) -> #pos(#s(#0())) , #succ(#neg(#s(#0()))) -> #0() , #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x)) , #succ(#pos(#s(@x))) -> #pos(#s(#s(@x))) , #and(#false(), #false()) -> #false() , #and(#false(), #true()) -> #false() , #and(#true(), #false()) -> #false() , #and(#true(), #true()) -> #true() , #natdiv(#0(), #0()) -> #divByZero() , #natdiv(#0(), #s(@y)) -> #0() , #natdiv(#s(@x), #0()) -> #divByZero() , #natdiv(#s(@x), #s(@y)) -> #natdiv'(#divsub(@x, @y), #s(@y)) , #positive(#0()) -> #0() , #positive(#neg(@x)) -> #neg(@x) , #positive(#pos(@x)) -> #pos(@x) , #positive(#s(@x)) -> #pos(#s(@x)) , #negative(#0()) -> #0() , #negative(#neg(@x)) -> #pos(@x) , #negative(#pos(@x)) -> #neg(@x) , #negative(#s(@x)) -> #neg(#s(@x)) , #divsub(#0(), #0()) -> #0() , #divsub(#0(), #s(@y)) -> #underflow() , #divsub(#s(@x), #0()) -> #s(@x) , #divsub(#s(@x), #s(@y)) -> #divsub(@x, @y) , #natmult(#0(), @y) -> #0() , #natmult(#s(@x), @y) -> #natadd(@y, #natmult(@x, @y)) , #natadd(#0(), @y) -> @y , #natadd(#s(@x), @y) -> #s(#natadd(@x, @y)) , #natdiv'(#0(), @y) -> #s(#0()) , #natdiv'(#s(@x), @y) -> #s(#natdiv(#s(@x), @y)) , #natdiv'(#underflow(), @y) -> #0() , #natsub(@x, #0()) -> @x , #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) } StartTerms: basic terms Strategy: innermost This problem was proven YES(O(1),O(n^1)). S) Strict DPs: { sub^#(@b1, @b2) -> c_18(sub'^#(@b1, @b2, #abs(#0()))) , sub'^#(@b1, @b2, @r) -> c_19(sub'#1^#(@b1, @b2, @r)) , sub'#1^#(::(@x, @xs), @b2, @r) -> c_20(sub'#2^#(@b2, @r, @x, @xs)) , sub'#2^#(::(@y, @ys), @r, @x, @xs) -> c_21(sub'#3^#(diff(@x, @y, @r), @xs, @ys)) , sub'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_22(sub'^#(@xs, @ys, @r')) } Weak DPs: { compare^#(@b1, @b2) -> c_9(compare#1^#(@b1, @b2)) , compare#1^#(::(@x, @xs), @b2) -> c_10(compare#2^#(@b2, @x, @xs)) , compare#2^#(::(@y, @ys), @x, @xs) -> c_11(compare^#(@xs, @ys)) , leq^#(@b1, @b2) -> c_12(compare^#(@b1, @b2)) } Weak Trs: { #abs(#0()) -> #0() , #abs(#neg(@x)) -> #pos(@x) , #abs(#pos(@x)) -> #pos(@x) , #abs(#s(@x)) -> #pos(#s(@x)) , #equal(@x, @y) -> #eq(@x, @y) , #eq(#0(), #0()) -> #true() , #eq(#0(), #neg(@y)) -> #false() , #eq(#0(), #pos(@y)) -> #false() , #eq(#0(), #s(@y)) -> #false() , #eq(#neg(@x), #0()) -> #false() , #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #pos(@y)) -> #false() , #eq(#pos(@x), #0()) -> #false() , #eq(#pos(@x), #neg(@y)) -> #false() , #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y) , #eq(#s(@x), #0()) -> #false() , #eq(#s(@x), #s(@y)) -> #eq(@x, @y) , #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #eq(::(@x_1, @x_2), nil()) -> #false() , #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false() , #eq(nil(), ::(@y_1, @y_2)) -> #false() , #eq(nil(), nil()) -> #true() , #eq(nil(), tuple#2(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), nil()) -> #false() , #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #greater(@x, @y) -> #ckgt(#compare(@x, @y)) , #compare(#0(), #0()) -> #EQ() , #compare(#0(), #neg(@y)) -> #GT() , #compare(#0(), #pos(@y)) -> #LT() , #compare(#0(), #s(@y)) -> #LT() , #compare(#neg(@x), #0()) -> #LT() , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x) , #compare(#neg(@x), #pos(@y)) -> #LT() , #compare(#pos(@x), #0()) -> #GT() , #compare(#pos(@x), #neg(@y)) -> #GT() , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y) , #compare(#s(@x), #0()) -> #GT() , #compare(#s(@x), #s(@y)) -> #compare(@x, @y) , #ckgt(#EQ()) -> #false() , #ckgt(#GT()) -> #true() , #ckgt(#LT()) -> #false() , #less(@x, @y) -> #cklt(#compare(@x, @y)) , #cklt(#EQ()) -> #false() , #cklt(#GT()) -> #false() , #cklt(#LT()) -> #true() , *(@x, @y) -> #mult(@x, @y) , #mult(#0(), #0()) -> #0() , #mult(#0(), #neg(@y)) -> #0() , #mult(#0(), #pos(@y)) -> #0() , #mult(#neg(@x), #0()) -> #0() , #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y)) , #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #0()) -> #0() , #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y)) , +(@x, @y) -> #add(@x, @y) , #add(#0(), @y) -> @y , #add(#neg(#s(#0())), @y) -> #pred(@y) , #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y)) , #add(#pos(#s(#0())), @y) -> #succ(@y) , #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y)) , -(@x, @y) -> #sub(@x, @y) , #sub(@x, #0()) -> @x , #sub(@x, #neg(@y)) -> #add(@x, #pos(@y)) , #sub(@x, #pos(@y)) -> #add(@x, #neg(@y)) , add(@b1, @b2) -> add'(@b1, @b2, #abs(#0())) , add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r) , add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs) , add'#1(nil(), @b2, @r) -> nil() , add'#2(::(@y, @ys), @r, @x, @xs) -> add'#3(sum(@x, @y, @r), @xs, @ys) , add'#2(nil(), @r, @x, @xs) -> nil() , sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r)) , add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r')) , bitToInt(@b) -> bitToInt'(@b, #abs(#pos(#s(#0())))) , bitToInt'(@b, @n) -> bitToInt'#1(@b, @n) , bitToInt'#1(::(@x, @xs), @n) -> +(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))) , bitToInt'#1(nil(), @n) -> #abs(#0()) , compare(@b1, @b2) -> compare#1(@b1, @b2) , compare#1(::(@x, @xs), @b2) -> compare#2(@b2, @x, @xs) , compare#1(nil(), @b2) -> #abs(#0()) , compare#2(::(@y, @ys), @x, @xs) -> compare#3(compare(@xs, @ys), @x, @y) , compare#2(nil(), @x, @xs) -> #abs(#0()) , compare#3(@r, @x, @y) -> compare#4(#equal(@r, #0()), @r, @x, @y) , compare#4(#false(), @r, @x, @y) -> @r , compare#4(#true(), @r, @x, @y) -> compare#5(#less(@x, @y), @x, @y) , compare#5(#false(), @x, @y) -> compare#6(#greater(@x, @y)) , compare#5(#true(), @x, @y) -> -(#0(), #pos(#s(#0()))) , compare#6(#false()) -> #abs(#0()) , compare#6(#true()) -> #abs(#pos(#s(#0()))) , diff(@x, @y, @r) -> tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))), diff#1(#less(-(-(@x, @y), @r), #0()))) , mod(@x, @y) -> -(@x, *(@y, div(@x, @y))) , diff#1(#false()) -> #abs(#0()) , diff#1(#true()) -> #abs(#pos(#s(#0()))) , div(@x, @y) -> #div(@x, @y) , #div(#0(), #0()) -> #divByZero() , #div(#0(), #neg(@y)) -> #0() , #div(#0(), #pos(@y)) -> #0() , #div(#neg(@x), #0()) -> #divByZero() , #div(#neg(@x), #neg(@y)) -> #positive(#natdiv(@x, @y)) , #div(#neg(@x), #pos(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #0()) -> #divByZero() , #div(#pos(@x), #neg(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #pos(@y)) -> #positive(#natdiv(@x, @y)) , leq(@b1, @b2) -> #less(compare(@b1, @b2), #pos(#s(#0()))) , mult(@b1, @b2) -> mult#1(@b1, @b2) , mult#1(::(@x, @xs), @b2) -> mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x) , mult#1(nil(), @b2) -> nil() , mult#2(@zs, @b2, @x) -> mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs) , mult#3(#false(), @b2, @zs) -> @zs , mult#3(#true(), @b2, @zs) -> add(@b2, @zs) , mult3(@b1, @b2, @b3) -> mult(mult(@b1, @b2), @b2) , sub(@b1, @b2) -> sub#1(sub'(@b1, @b2, #abs(#0()))) , sub'(@b1, @b2, @r) -> sub'#1(@b1, @b2, @r) , sub#1(tuple#2(@b, @_@1)) -> @b , sub'#1(::(@x, @xs), @b2, @r) -> sub'#2(@b2, @r, @x, @xs) , sub'#1(nil(), @b2, @r) -> tuple#2(nil(), @r) , sub'#2(::(@y, @ys), @r, @x, @xs) -> sub'#3(diff(@x, @y, @r), @xs, @ys) , sub'#2(nil(), @r, @x, @xs) -> tuple#2(nil(), @r) , sub'#3(tuple#2(@z, @r'), @xs, @ys) -> sub'#4(sub'(@xs, @ys, @r'), @z) , sub'#4(tuple#2(@zs, @s), @z) -> tuple#2(sub'#5(#equal(@s, #pos(#s(#0()))), @z, @zs), @s) , sub'#5(#false(), @z, @zs) -> ::(@z, @zs) , sub'#5(#true(), @z, @zs) -> ::(#abs(#0()), @zs) , sum#1(@s) -> sum#2(#equal(@s, #0()), @s) , sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s) , sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0())) , sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0()))))) , sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0())) , sum#4(#false()) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0())))) , sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0())))) , #pred(#0()) -> #neg(#s(#0())) , #pred(#neg(#s(@x))) -> #neg(#s(#s(@x))) , #pred(#pos(#s(#0()))) -> #0() , #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x)) , #succ(#0()) -> #pos(#s(#0())) , #succ(#neg(#s(#0()))) -> #0() , #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x)) , #succ(#pos(#s(@x))) -> #pos(#s(#s(@x))) , #and(#false(), #false()) -> #false() , #and(#false(), #true()) -> #false() , #and(#true(), #false()) -> #false() , #and(#true(), #true()) -> #true() , #natdiv(#0(), #0()) -> #divByZero() , #natdiv(#0(), #s(@y)) -> #0() , #natdiv(#s(@x), #0()) -> #divByZero() , #natdiv(#s(@x), #s(@y)) -> #natdiv'(#divsub(@x, @y), #s(@y)) , #positive(#0()) -> #0() , #positive(#neg(@x)) -> #neg(@x) , #positive(#pos(@x)) -> #pos(@x) , #positive(#s(@x)) -> #pos(#s(@x)) , #negative(#0()) -> #0() , #negative(#neg(@x)) -> #pos(@x) , #negative(#pos(@x)) -> #neg(@x) , #negative(#s(@x)) -> #neg(#s(@x)) , #divsub(#0(), #0()) -> #0() , #divsub(#0(), #s(@y)) -> #underflow() , #divsub(#s(@x), #0()) -> #s(@x) , #divsub(#s(@x), #s(@y)) -> #divsub(@x, @y) , #natmult(#0(), @y) -> #0() , #natmult(#s(@x), @y) -> #natadd(@y, #natmult(@x, @y)) , #natadd(#0(), @y) -> @y , #natadd(#s(@x), @y) -> #s(#natadd(@x, @y)) , #natdiv'(#0(), @y) -> #s(#0()) , #natdiv'(#s(@x), @y) -> #s(#natdiv(#s(@x), @y)) , #natdiv'(#underflow(), @y) -> #0() , #natsub(@x, #0()) -> @x , #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) } StartTerms: basic terms Strategy: innermost This problem was proven YES(O(1),O(n^1)). Proofs for generated problems: ------------------------------ R) We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^1)). Strict DPs: { compare^#(@b1, @b2) -> c_9(compare#1^#(@b1, @b2)) , compare#1^#(::(@x, @xs), @b2) -> c_10(compare#2^#(@b2, @x, @xs)) , compare#2^#(::(@y, @ys), @x, @xs) -> c_11(compare^#(@xs, @ys)) , leq^#(@b1, @b2) -> c_12(compare^#(@b1, @b2)) } Weak DPs: { sub^#(@b1, @b2) -> c_18(sub'^#(@b1, @b2, #abs(#0()))) , sub'^#(@b1, @b2, @r) -> c_19(sub'#1^#(@b1, @b2, @r)) , sub'#1^#(::(@x, @xs), @b2, @r) -> c_20(sub'#2^#(@b2, @r, @x, @xs)) , sub'#2^#(::(@y, @ys), @r, @x, @xs) -> c_21(sub'#3^#(diff(@x, @y, @r), @xs, @ys)) , sub'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_22(sub'^#(@xs, @ys, @r')) } Weak Trs: { #abs(#0()) -> #0() , #abs(#neg(@x)) -> #pos(@x) , #abs(#pos(@x)) -> #pos(@x) , #abs(#s(@x)) -> #pos(#s(@x)) , #equal(@x, @y) -> #eq(@x, @y) , #eq(#0(), #0()) -> #true() , #eq(#0(), #neg(@y)) -> #false() , #eq(#0(), #pos(@y)) -> #false() , #eq(#0(), #s(@y)) -> #false() , #eq(#neg(@x), #0()) -> #false() , #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #pos(@y)) -> #false() , #eq(#pos(@x), #0()) -> #false() , #eq(#pos(@x), #neg(@y)) -> #false() , #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y) , #eq(#s(@x), #0()) -> #false() , #eq(#s(@x), #s(@y)) -> #eq(@x, @y) , #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #eq(::(@x_1, @x_2), nil()) -> #false() , #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false() , #eq(nil(), ::(@y_1, @y_2)) -> #false() , #eq(nil(), nil()) -> #true() , #eq(nil(), tuple#2(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), nil()) -> #false() , #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #greater(@x, @y) -> #ckgt(#compare(@x, @y)) , #compare(#0(), #0()) -> #EQ() , #compare(#0(), #neg(@y)) -> #GT() , #compare(#0(), #pos(@y)) -> #LT() , #compare(#0(), #s(@y)) -> #LT() , #compare(#neg(@x), #0()) -> #LT() , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x) , #compare(#neg(@x), #pos(@y)) -> #LT() , #compare(#pos(@x), #0()) -> #GT() , #compare(#pos(@x), #neg(@y)) -> #GT() , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y) , #compare(#s(@x), #0()) -> #GT() , #compare(#s(@x), #s(@y)) -> #compare(@x, @y) , #ckgt(#EQ()) -> #false() , #ckgt(#GT()) -> #true() , #ckgt(#LT()) -> #false() , #less(@x, @y) -> #cklt(#compare(@x, @y)) , #cklt(#EQ()) -> #false() , #cklt(#GT()) -> #false() , #cklt(#LT()) -> #true() , *(@x, @y) -> #mult(@x, @y) , #mult(#0(), #0()) -> #0() , #mult(#0(), #neg(@y)) -> #0() , #mult(#0(), #pos(@y)) -> #0() , #mult(#neg(@x), #0()) -> #0() , #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y)) , #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #0()) -> #0() , #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y)) , +(@x, @y) -> #add(@x, @y) , #add(#0(), @y) -> @y , #add(#neg(#s(#0())), @y) -> #pred(@y) , #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y)) , #add(#pos(#s(#0())), @y) -> #succ(@y) , #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y)) , -(@x, @y) -> #sub(@x, @y) , #sub(@x, #0()) -> @x , #sub(@x, #neg(@y)) -> #add(@x, #pos(@y)) , #sub(@x, #pos(@y)) -> #add(@x, #neg(@y)) , add(@b1, @b2) -> add'(@b1, @b2, #abs(#0())) , add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r) , add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs) , add'#1(nil(), @b2, @r) -> nil() , add'#2(::(@y, @ys), @r, @x, @xs) -> add'#3(sum(@x, @y, @r), @xs, @ys) , add'#2(nil(), @r, @x, @xs) -> nil() , sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r)) , add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r')) , bitToInt(@b) -> bitToInt'(@b, #abs(#pos(#s(#0())))) , bitToInt'(@b, @n) -> bitToInt'#1(@b, @n) , bitToInt'#1(::(@x, @xs), @n) -> +(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))) , bitToInt'#1(nil(), @n) -> #abs(#0()) , compare(@b1, @b2) -> compare#1(@b1, @b2) , compare#1(::(@x, @xs), @b2) -> compare#2(@b2, @x, @xs) , compare#1(nil(), @b2) -> #abs(#0()) , compare#2(::(@y, @ys), @x, @xs) -> compare#3(compare(@xs, @ys), @x, @y) , compare#2(nil(), @x, @xs) -> #abs(#0()) , compare#3(@r, @x, @y) -> compare#4(#equal(@r, #0()), @r, @x, @y) , compare#4(#false(), @r, @x, @y) -> @r , compare#4(#true(), @r, @x, @y) -> compare#5(#less(@x, @y), @x, @y) , compare#5(#false(), @x, @y) -> compare#6(#greater(@x, @y)) , compare#5(#true(), @x, @y) -> -(#0(), #pos(#s(#0()))) , compare#6(#false()) -> #abs(#0()) , compare#6(#true()) -> #abs(#pos(#s(#0()))) , diff(@x, @y, @r) -> tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))), diff#1(#less(-(-(@x, @y), @r), #0()))) , mod(@x, @y) -> -(@x, *(@y, div(@x, @y))) , diff#1(#false()) -> #abs(#0()) , diff#1(#true()) -> #abs(#pos(#s(#0()))) , div(@x, @y) -> #div(@x, @y) , #div(#0(), #0()) -> #divByZero() , #div(#0(), #neg(@y)) -> #0() , #div(#0(), #pos(@y)) -> #0() , #div(#neg(@x), #0()) -> #divByZero() , #div(#neg(@x), #neg(@y)) -> #positive(#natdiv(@x, @y)) , #div(#neg(@x), #pos(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #0()) -> #divByZero() , #div(#pos(@x), #neg(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #pos(@y)) -> #positive(#natdiv(@x, @y)) , leq(@b1, @b2) -> #less(compare(@b1, @b2), #pos(#s(#0()))) , mult(@b1, @b2) -> mult#1(@b1, @b2) , mult#1(::(@x, @xs), @b2) -> mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x) , mult#1(nil(), @b2) -> nil() , mult#2(@zs, @b2, @x) -> mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs) , mult#3(#false(), @b2, @zs) -> @zs , mult#3(#true(), @b2, @zs) -> add(@b2, @zs) , mult3(@b1, @b2, @b3) -> mult(mult(@b1, @b2), @b2) , sub(@b1, @b2) -> sub#1(sub'(@b1, @b2, #abs(#0()))) , sub'(@b1, @b2, @r) -> sub'#1(@b1, @b2, @r) , sub#1(tuple#2(@b, @_@1)) -> @b , sub'#1(::(@x, @xs), @b2, @r) -> sub'#2(@b2, @r, @x, @xs) , sub'#1(nil(), @b2, @r) -> tuple#2(nil(), @r) , sub'#2(::(@y, @ys), @r, @x, @xs) -> sub'#3(diff(@x, @y, @r), @xs, @ys) , sub'#2(nil(), @r, @x, @xs) -> tuple#2(nil(), @r) , sub'#3(tuple#2(@z, @r'), @xs, @ys) -> sub'#4(sub'(@xs, @ys, @r'), @z) , sub'#4(tuple#2(@zs, @s), @z) -> tuple#2(sub'#5(#equal(@s, #pos(#s(#0()))), @z, @zs), @s) , sub'#5(#false(), @z, @zs) -> ::(@z, @zs) , sub'#5(#true(), @z, @zs) -> ::(#abs(#0()), @zs) , sum#1(@s) -> sum#2(#equal(@s, #0()), @s) , sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s) , sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0())) , sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0()))))) , sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0())) , sum#4(#false()) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0())))) , sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0())))) , #pred(#0()) -> #neg(#s(#0())) , #pred(#neg(#s(@x))) -> #neg(#s(#s(@x))) , #pred(#pos(#s(#0()))) -> #0() , #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x)) , #succ(#0()) -> #pos(#s(#0())) , #succ(#neg(#s(#0()))) -> #0() , #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x)) , #succ(#pos(#s(@x))) -> #pos(#s(#s(@x))) , #and(#false(), #false()) -> #false() , #and(#false(), #true()) -> #false() , #and(#true(), #false()) -> #false() , #and(#true(), #true()) -> #true() , #natdiv(#0(), #0()) -> #divByZero() , #natdiv(#0(), #s(@y)) -> #0() , #natdiv(#s(@x), #0()) -> #divByZero() , #natdiv(#s(@x), #s(@y)) -> #natdiv'(#divsub(@x, @y), #s(@y)) , #positive(#0()) -> #0() , #positive(#neg(@x)) -> #neg(@x) , #positive(#pos(@x)) -> #pos(@x) , #positive(#s(@x)) -> #pos(#s(@x)) , #negative(#0()) -> #0() , #negative(#neg(@x)) -> #pos(@x) , #negative(#pos(@x)) -> #neg(@x) , #negative(#s(@x)) -> #neg(#s(@x)) , #divsub(#0(), #0()) -> #0() , #divsub(#0(), #s(@y)) -> #underflow() , #divsub(#s(@x), #0()) -> #s(@x) , #divsub(#s(@x), #s(@y)) -> #divsub(@x, @y) , #natmult(#0(), @y) -> #0() , #natmult(#s(@x), @y) -> #natadd(@y, #natmult(@x, @y)) , #natadd(#0(), @y) -> @y , #natadd(#s(@x), @y) -> #s(#natadd(@x, @y)) , #natdiv'(#0(), @y) -> #s(#0()) , #natdiv'(#s(@x), @y) -> #s(#natdiv(#s(@x), @y)) , #natdiv'(#underflow(), @y) -> #0() , #natsub(@x, #0()) -> @x , #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^1)) The following weak DPs constitute a sub-graph of the DG that is closed under successors. The DPs are removed. { sub^#(@b1, @b2) -> c_18(sub'^#(@b1, @b2, #abs(#0()))) , sub'^#(@b1, @b2, @r) -> c_19(sub'#1^#(@b1, @b2, @r)) , sub'#1^#(::(@x, @xs), @b2, @r) -> c_20(sub'#2^#(@b2, @r, @x, @xs)) , sub'#2^#(::(@y, @ys), @r, @x, @xs) -> c_21(sub'#3^#(diff(@x, @y, @r), @xs, @ys)) , sub'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_22(sub'^#(@xs, @ys, @r')) } We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^1)). Strict DPs: { compare^#(@b1, @b2) -> c_9(compare#1^#(@b1, @b2)) , compare#1^#(::(@x, @xs), @b2) -> c_10(compare#2^#(@b2, @x, @xs)) , compare#2^#(::(@y, @ys), @x, @xs) -> c_11(compare^#(@xs, @ys)) , leq^#(@b1, @b2) -> c_12(compare^#(@b1, @b2)) } Weak Trs: { #abs(#0()) -> #0() , #abs(#neg(@x)) -> #pos(@x) , #abs(#pos(@x)) -> #pos(@x) , #abs(#s(@x)) -> #pos(#s(@x)) , #equal(@x, @y) -> #eq(@x, @y) , #eq(#0(), #0()) -> #true() , #eq(#0(), #neg(@y)) -> #false() , #eq(#0(), #pos(@y)) -> #false() , #eq(#0(), #s(@y)) -> #false() , #eq(#neg(@x), #0()) -> #false() , #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #pos(@y)) -> #false() , #eq(#pos(@x), #0()) -> #false() , #eq(#pos(@x), #neg(@y)) -> #false() , #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y) , #eq(#s(@x), #0()) -> #false() , #eq(#s(@x), #s(@y)) -> #eq(@x, @y) , #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #eq(::(@x_1, @x_2), nil()) -> #false() , #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false() , #eq(nil(), ::(@y_1, @y_2)) -> #false() , #eq(nil(), nil()) -> #true() , #eq(nil(), tuple#2(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), nil()) -> #false() , #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #greater(@x, @y) -> #ckgt(#compare(@x, @y)) , #compare(#0(), #0()) -> #EQ() , #compare(#0(), #neg(@y)) -> #GT() , #compare(#0(), #pos(@y)) -> #LT() , #compare(#0(), #s(@y)) -> #LT() , #compare(#neg(@x), #0()) -> #LT() , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x) , #compare(#neg(@x), #pos(@y)) -> #LT() , #compare(#pos(@x), #0()) -> #GT() , #compare(#pos(@x), #neg(@y)) -> #GT() , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y) , #compare(#s(@x), #0()) -> #GT() , #compare(#s(@x), #s(@y)) -> #compare(@x, @y) , #ckgt(#EQ()) -> #false() , #ckgt(#GT()) -> #true() , #ckgt(#LT()) -> #false() , #less(@x, @y) -> #cklt(#compare(@x, @y)) , #cklt(#EQ()) -> #false() , #cklt(#GT()) -> #false() , #cklt(#LT()) -> #true() , *(@x, @y) -> #mult(@x, @y) , #mult(#0(), #0()) -> #0() , #mult(#0(), #neg(@y)) -> #0() , #mult(#0(), #pos(@y)) -> #0() , #mult(#neg(@x), #0()) -> #0() , #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y)) , #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #0()) -> #0() , #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y)) , +(@x, @y) -> #add(@x, @y) , #add(#0(), @y) -> @y , #add(#neg(#s(#0())), @y) -> #pred(@y) , #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y)) , #add(#pos(#s(#0())), @y) -> #succ(@y) , #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y)) , -(@x, @y) -> #sub(@x, @y) , #sub(@x, #0()) -> @x , #sub(@x, #neg(@y)) -> #add(@x, #pos(@y)) , #sub(@x, #pos(@y)) -> #add(@x, #neg(@y)) , add(@b1, @b2) -> add'(@b1, @b2, #abs(#0())) , add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r) , add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs) , add'#1(nil(), @b2, @r) -> nil() , add'#2(::(@y, @ys), @r, @x, @xs) -> add'#3(sum(@x, @y, @r), @xs, @ys) , add'#2(nil(), @r, @x, @xs) -> nil() , sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r)) , add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r')) , bitToInt(@b) -> bitToInt'(@b, #abs(#pos(#s(#0())))) , bitToInt'(@b, @n) -> bitToInt'#1(@b, @n) , bitToInt'#1(::(@x, @xs), @n) -> +(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))) , bitToInt'#1(nil(), @n) -> #abs(#0()) , compare(@b1, @b2) -> compare#1(@b1, @b2) , compare#1(::(@x, @xs), @b2) -> compare#2(@b2, @x, @xs) , compare#1(nil(), @b2) -> #abs(#0()) , compare#2(::(@y, @ys), @x, @xs) -> compare#3(compare(@xs, @ys), @x, @y) , compare#2(nil(), @x, @xs) -> #abs(#0()) , compare#3(@r, @x, @y) -> compare#4(#equal(@r, #0()), @r, @x, @y) , compare#4(#false(), @r, @x, @y) -> @r , compare#4(#true(), @r, @x, @y) -> compare#5(#less(@x, @y), @x, @y) , compare#5(#false(), @x, @y) -> compare#6(#greater(@x, @y)) , compare#5(#true(), @x, @y) -> -(#0(), #pos(#s(#0()))) , compare#6(#false()) -> #abs(#0()) , compare#6(#true()) -> #abs(#pos(#s(#0()))) , diff(@x, @y, @r) -> tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))), diff#1(#less(-(-(@x, @y), @r), #0()))) , mod(@x, @y) -> -(@x, *(@y, div(@x, @y))) , diff#1(#false()) -> #abs(#0()) , diff#1(#true()) -> #abs(#pos(#s(#0()))) , div(@x, @y) -> #div(@x, @y) , #div(#0(), #0()) -> #divByZero() , #div(#0(), #neg(@y)) -> #0() , #div(#0(), #pos(@y)) -> #0() , #div(#neg(@x), #0()) -> #divByZero() , #div(#neg(@x), #neg(@y)) -> #positive(#natdiv(@x, @y)) , #div(#neg(@x), #pos(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #0()) -> #divByZero() , #div(#pos(@x), #neg(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #pos(@y)) -> #positive(#natdiv(@x, @y)) , leq(@b1, @b2) -> #less(compare(@b1, @b2), #pos(#s(#0()))) , mult(@b1, @b2) -> mult#1(@b1, @b2) , mult#1(::(@x, @xs), @b2) -> mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x) , mult#1(nil(), @b2) -> nil() , mult#2(@zs, @b2, @x) -> mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs) , mult#3(#false(), @b2, @zs) -> @zs , mult#3(#true(), @b2, @zs) -> add(@b2, @zs) , mult3(@b1, @b2, @b3) -> mult(mult(@b1, @b2), @b2) , sub(@b1, @b2) -> sub#1(sub'(@b1, @b2, #abs(#0()))) , sub'(@b1, @b2, @r) -> sub'#1(@b1, @b2, @r) , sub#1(tuple#2(@b, @_@1)) -> @b , sub'#1(::(@x, @xs), @b2, @r) -> sub'#2(@b2, @r, @x, @xs) , sub'#1(nil(), @b2, @r) -> tuple#2(nil(), @r) , sub'#2(::(@y, @ys), @r, @x, @xs) -> sub'#3(diff(@x, @y, @r), @xs, @ys) , sub'#2(nil(), @r, @x, @xs) -> tuple#2(nil(), @r) , sub'#3(tuple#2(@z, @r'), @xs, @ys) -> sub'#4(sub'(@xs, @ys, @r'), @z) , sub'#4(tuple#2(@zs, @s), @z) -> tuple#2(sub'#5(#equal(@s, #pos(#s(#0()))), @z, @zs), @s) , sub'#5(#false(), @z, @zs) -> ::(@z, @zs) , sub'#5(#true(), @z, @zs) -> ::(#abs(#0()), @zs) , sum#1(@s) -> sum#2(#equal(@s, #0()), @s) , sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s) , sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0())) , sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0()))))) , sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0())) , sum#4(#false()) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0())))) , sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0())))) , #pred(#0()) -> #neg(#s(#0())) , #pred(#neg(#s(@x))) -> #neg(#s(#s(@x))) , #pred(#pos(#s(#0()))) -> #0() , #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x)) , #succ(#0()) -> #pos(#s(#0())) , #succ(#neg(#s(#0()))) -> #0() , #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x)) , #succ(#pos(#s(@x))) -> #pos(#s(#s(@x))) , #and(#false(), #false()) -> #false() , #and(#false(), #true()) -> #false() , #and(#true(), #false()) -> #false() , #and(#true(), #true()) -> #true() , #natdiv(#0(), #0()) -> #divByZero() , #natdiv(#0(), #s(@y)) -> #0() , #natdiv(#s(@x), #0()) -> #divByZero() , #natdiv(#s(@x), #s(@y)) -> #natdiv'(#divsub(@x, @y), #s(@y)) , #positive(#0()) -> #0() , #positive(#neg(@x)) -> #neg(@x) , #positive(#pos(@x)) -> #pos(@x) , #positive(#s(@x)) -> #pos(#s(@x)) , #negative(#0()) -> #0() , #negative(#neg(@x)) -> #pos(@x) , #negative(#pos(@x)) -> #neg(@x) , #negative(#s(@x)) -> #neg(#s(@x)) , #divsub(#0(), #0()) -> #0() , #divsub(#0(), #s(@y)) -> #underflow() , #divsub(#s(@x), #0()) -> #s(@x) , #divsub(#s(@x), #s(@y)) -> #divsub(@x, @y) , #natmult(#0(), @y) -> #0() , #natmult(#s(@x), @y) -> #natadd(@y, #natmult(@x, @y)) , #natadd(#0(), @y) -> @y , #natadd(#s(@x), @y) -> #s(#natadd(@x, @y)) , #natdiv'(#0(), @y) -> #s(#0()) , #natdiv'(#s(@x), @y) -> #s(#natdiv(#s(@x), @y)) , #natdiv'(#underflow(), @y) -> #0() , #natsub(@x, #0()) -> @x , #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^1)) No rule is usable, rules are removed from the input problem. We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^1)). Strict DPs: { compare^#(@b1, @b2) -> c_9(compare#1^#(@b1, @b2)) , compare#1^#(::(@x, @xs), @b2) -> c_10(compare#2^#(@b2, @x, @xs)) , compare#2^#(::(@y, @ys), @x, @xs) -> c_11(compare^#(@xs, @ys)) , leq^#(@b1, @b2) -> c_12(compare^#(@b1, @b2)) } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^1)) We use the processor 'matrix interpretation of dimension 1' to orient following rules strictly. DPs: { 2: compare#1^#(::(@x, @xs), @b2) -> c_10(compare#2^#(@b2, @x, @xs)) } Sub-proof: ---------- The following argument positions are usable: Uargs(c_9) = {1}, Uargs(c_10) = {1}, Uargs(c_11) = {1}, Uargs(c_12) = {1} TcT has computed following constructor-based matrix interpretation satisfying not(EDA). [#0] = [0] [#neg](x1) = [0] [#pos](x1) = [0] [#s](x1) = [0] [::](x1, x2) = [1] x2 + [1] [nil] = [0] [tuple#2](x1, x2) = [0] [#false] = [0] [#true] = [0] [#EQ] = [0] [#GT] = [0] [#LT] = [0] [#divByZero] = [0] [#underflow] = [0] [#abs^#](x1) = [0] [#equal^#](x1, x2) = [0] [#eq^#](x1, x2) = [0] [#greater^#](x1, x2) = [0] [#ckgt^#](x1) = [0] [#compare^#](x1, x2) = [0] [#less^#](x1, x2) = [0] [#cklt^#](x1) = [0] [*^#](x1, x2) = [0] [#mult^#](x1, x2) = [0] [+^#](x1, x2) = [0] [#add^#](x1, x2) = [0] [-^#](x1, x2) = [0] [#sub^#](x1, x2) = [0] [add^#](x1, x2) = [0] [add'^#](x1, x2, x3) = [0] [add'#1^#](x1, x2, x3) = [0] [add'#2^#](x1, x2, x3, x4) = [0] [add'#3^#](x1, x2, x3) = [0] [sum^#](x1, x2, x3) = [0] [sum#1^#](x1) = [0] [bitToInt^#](x1) = [0] [bitToInt'^#](x1, x2) = [0] [bitToInt'#1^#](x1, x2) = [0] [compare^#](x1, x2) = [1] x2 + [1] [compare#1^#](x1, x2) = [1] x2 + [1] [compare#2^#](x1, x2, x3) = [1] x1 + [0] [compare#3^#](x1, x2, x3) = [0] [compare#4^#](x1, x2, x3, x4) = [0] [compare#5^#](x1, x2, x3) = [0] [compare#6^#](x1) = [0] [diff^#](x1, x2, x3) = [0] [mod^#](x1, x2) = [0] [diff#1^#](x1) = [0] [div^#](x1, x2) = [0] [#div^#](x1, x2) = [0] [leq^#](x1, x2) = [1] x1 + [1] x2 + [1] [mult^#](x1, x2) = [0] [mult#1^#](x1, x2) = [0] [mult#2^#](x1, x2, x3) = [0] [mult#3^#](x1, x2, x3) = [0] [mult3^#](x1, x2, x3) = [0] [sub^#](x1, x2) = [0] [sub#1^#](x1) = [0] [sub'^#](x1, x2, x3) = [0] [sub'#1^#](x1, x2, x3) = [0] [sub'#2^#](x1, x2, x3, x4) = [0] [sub'#3^#](x1, x2, x3) = [0] [sub'#4^#](x1, x2) = [0] [sub'#5^#](x1, x2, x3) = [0] [sum#2^#](x1, x2) = [0] [sum#3^#](x1, x2) = [0] [sum#4^#](x1) = [0] [#and^#](x1, x2) = [0] [#natmult^#](x1, x2) = [0] [#pred^#](x1) = [0] [#succ^#](x1) = [0] [#positive^#](x1) = [0] [#natdiv^#](x1, x2) = [0] [#negative^#](x1) = [0] [#natdiv'^#](x1, x2) = [0] [#divsub^#](x1, x2) = [0] [#natadd^#](x1, x2) = [0] [#natsub^#](x1, x2) = [0] [c_9](x1) = [1] x1 + [0] [c_10](x1) = [1] x1 + [0] [c_11](x1) = [1] x1 + [0] [c_12](x1) = [1] x1 + [0] This order satisfies following ordering constraints [compare^#(@b1, @b2)] = [1] @b2 + [1] >= [1] @b2 + [1] = [c_9(compare#1^#(@b1, @b2))] [compare#1^#(::(@x, @xs), @b2)] = [1] @b2 + [1] > [1] @b2 + [0] = [c_10(compare#2^#(@b2, @x, @xs))] [compare#2^#(::(@y, @ys), @x, @xs)] = [1] @ys + [1] >= [1] @ys + [1] = [c_11(compare^#(@xs, @ys))] [leq^#(@b1, @b2)] = [1] @b1 + [1] @b2 + [1] >= [1] @b2 + [1] = [c_12(compare^#(@b1, @b2))] Consider the set of all dependency pairs DPs: { 1: compare^#(@b1, @b2) -> c_9(compare#1^#(@b1, @b2)) , 2: compare#1^#(::(@x, @xs), @b2) -> c_10(compare#2^#(@b2, @x, @xs)) , 3: compare#2^#(::(@y, @ys), @x, @xs) -> c_11(compare^#(@xs, @ys)) , 4: leq^#(@b1, @b2) -> c_12(compare^#(@b1, @b2)) } Processor 'matrix interpretation of dimension 1' induces the complexity certificate YES(?,O(n^1)) on application of dependency pairs {2}. These cover all (indirect) predecessors of dependency pairs {1,2,3,4}, their number of application is equally bounded. The dependency pairs are shifted into the corresponding weak component(s). We apply the transformation 'removetails' on the sub-problem: Weak DPs: { compare^#(@b1, @b2) -> c_9(compare#1^#(@b1, @b2)) , compare#1^#(::(@x, @xs), @b2) -> c_10(compare#2^#(@b2, @x, @xs)) , compare#2^#(::(@y, @ys), @x, @xs) -> c_11(compare^#(@xs, @ys)) , leq^#(@b1, @b2) -> c_12(compare^#(@b1, @b2)) } StartTerms: basic terms Strategy: innermost The following weak DPs constitute a sub-graph of the DG that is closed under successors. The DPs are removed. { compare^#(@b1, @b2) -> c_9(compare#1^#(@b1, @b2)) , compare#1^#(::(@x, @xs), @b2) -> c_10(compare#2^#(@b2, @x, @xs)) , compare#2^#(::(@y, @ys), @x, @xs) -> c_11(compare^#(@xs, @ys)) , leq^#(@b1, @b2) -> c_12(compare^#(@b1, @b2)) } We are left with following problem, upon which TcT provides the certificate YES(O(1),O(1)). Rules: Empty Obligation: innermost runtime complexity Answer: YES(O(1),O(1)) Empty rules are trivially bounded Wall-time: 0.94897s CPU-time: 10.96s S) We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^1)). Strict DPs: { sub^#(@b1, @b2) -> c_18(sub'^#(@b1, @b2, #abs(#0()))) , sub'^#(@b1, @b2, @r) -> c_19(sub'#1^#(@b1, @b2, @r)) , sub'#1^#(::(@x, @xs), @b2, @r) -> c_20(sub'#2^#(@b2, @r, @x, @xs)) , sub'#2^#(::(@y, @ys), @r, @x, @xs) -> c_21(sub'#3^#(diff(@x, @y, @r), @xs, @ys)) , sub'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_22(sub'^#(@xs, @ys, @r')) } Weak DPs: { compare^#(@b1, @b2) -> c_9(compare#1^#(@b1, @b2)) , compare#1^#(::(@x, @xs), @b2) -> c_10(compare#2^#(@b2, @x, @xs)) , compare#2^#(::(@y, @ys), @x, @xs) -> c_11(compare^#(@xs, @ys)) , leq^#(@b1, @b2) -> c_12(compare^#(@b1, @b2)) } Weak Trs: { #abs(#0()) -> #0() , #abs(#neg(@x)) -> #pos(@x) , #abs(#pos(@x)) -> #pos(@x) , #abs(#s(@x)) -> #pos(#s(@x)) , #equal(@x, @y) -> #eq(@x, @y) , #eq(#0(), #0()) -> #true() , #eq(#0(), #neg(@y)) -> #false() , #eq(#0(), #pos(@y)) -> #false() , #eq(#0(), #s(@y)) -> #false() , #eq(#neg(@x), #0()) -> #false() , #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #pos(@y)) -> #false() , #eq(#pos(@x), #0()) -> #false() , #eq(#pos(@x), #neg(@y)) -> #false() , #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y) , #eq(#s(@x), #0()) -> #false() , #eq(#s(@x), #s(@y)) -> #eq(@x, @y) , #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #eq(::(@x_1, @x_2), nil()) -> #false() , #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false() , #eq(nil(), ::(@y_1, @y_2)) -> #false() , #eq(nil(), nil()) -> #true() , #eq(nil(), tuple#2(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), nil()) -> #false() , #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #greater(@x, @y) -> #ckgt(#compare(@x, @y)) , #compare(#0(), #0()) -> #EQ() , #compare(#0(), #neg(@y)) -> #GT() , #compare(#0(), #pos(@y)) -> #LT() , #compare(#0(), #s(@y)) -> #LT() , #compare(#neg(@x), #0()) -> #LT() , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x) , #compare(#neg(@x), #pos(@y)) -> #LT() , #compare(#pos(@x), #0()) -> #GT() , #compare(#pos(@x), #neg(@y)) -> #GT() , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y) , #compare(#s(@x), #0()) -> #GT() , #compare(#s(@x), #s(@y)) -> #compare(@x, @y) , #ckgt(#EQ()) -> #false() , #ckgt(#GT()) -> #true() , #ckgt(#LT()) -> #false() , #less(@x, @y) -> #cklt(#compare(@x, @y)) , #cklt(#EQ()) -> #false() , #cklt(#GT()) -> #false() , #cklt(#LT()) -> #true() , *(@x, @y) -> #mult(@x, @y) , #mult(#0(), #0()) -> #0() , #mult(#0(), #neg(@y)) -> #0() , #mult(#0(), #pos(@y)) -> #0() , #mult(#neg(@x), #0()) -> #0() , #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y)) , #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #0()) -> #0() , #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y)) , +(@x, @y) -> #add(@x, @y) , #add(#0(), @y) -> @y , #add(#neg(#s(#0())), @y) -> #pred(@y) , #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y)) , #add(#pos(#s(#0())), @y) -> #succ(@y) , #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y)) , -(@x, @y) -> #sub(@x, @y) , #sub(@x, #0()) -> @x , #sub(@x, #neg(@y)) -> #add(@x, #pos(@y)) , #sub(@x, #pos(@y)) -> #add(@x, #neg(@y)) , add(@b1, @b2) -> add'(@b1, @b2, #abs(#0())) , add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r) , add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs) , add'#1(nil(), @b2, @r) -> nil() , add'#2(::(@y, @ys), @r, @x, @xs) -> add'#3(sum(@x, @y, @r), @xs, @ys) , add'#2(nil(), @r, @x, @xs) -> nil() , sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r)) , add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r')) , bitToInt(@b) -> bitToInt'(@b, #abs(#pos(#s(#0())))) , bitToInt'(@b, @n) -> bitToInt'#1(@b, @n) , bitToInt'#1(::(@x, @xs), @n) -> +(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))) , bitToInt'#1(nil(), @n) -> #abs(#0()) , compare(@b1, @b2) -> compare#1(@b1, @b2) , compare#1(::(@x, @xs), @b2) -> compare#2(@b2, @x, @xs) , compare#1(nil(), @b2) -> #abs(#0()) , compare#2(::(@y, @ys), @x, @xs) -> compare#3(compare(@xs, @ys), @x, @y) , compare#2(nil(), @x, @xs) -> #abs(#0()) , compare#3(@r, @x, @y) -> compare#4(#equal(@r, #0()), @r, @x, @y) , compare#4(#false(), @r, @x, @y) -> @r , compare#4(#true(), @r, @x, @y) -> compare#5(#less(@x, @y), @x, @y) , compare#5(#false(), @x, @y) -> compare#6(#greater(@x, @y)) , compare#5(#true(), @x, @y) -> -(#0(), #pos(#s(#0()))) , compare#6(#false()) -> #abs(#0()) , compare#6(#true()) -> #abs(#pos(#s(#0()))) , diff(@x, @y, @r) -> tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))), diff#1(#less(-(-(@x, @y), @r), #0()))) , mod(@x, @y) -> -(@x, *(@y, div(@x, @y))) , diff#1(#false()) -> #abs(#0()) , diff#1(#true()) -> #abs(#pos(#s(#0()))) , div(@x, @y) -> #div(@x, @y) , #div(#0(), #0()) -> #divByZero() , #div(#0(), #neg(@y)) -> #0() , #div(#0(), #pos(@y)) -> #0() , #div(#neg(@x), #0()) -> #divByZero() , #div(#neg(@x), #neg(@y)) -> #positive(#natdiv(@x, @y)) , #div(#neg(@x), #pos(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #0()) -> #divByZero() , #div(#pos(@x), #neg(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #pos(@y)) -> #positive(#natdiv(@x, @y)) , leq(@b1, @b2) -> #less(compare(@b1, @b2), #pos(#s(#0()))) , mult(@b1, @b2) -> mult#1(@b1, @b2) , mult#1(::(@x, @xs), @b2) -> mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x) , mult#1(nil(), @b2) -> nil() , mult#2(@zs, @b2, @x) -> mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs) , mult#3(#false(), @b2, @zs) -> @zs , mult#3(#true(), @b2, @zs) -> add(@b2, @zs) , mult3(@b1, @b2, @b3) -> mult(mult(@b1, @b2), @b2) , sub(@b1, @b2) -> sub#1(sub'(@b1, @b2, #abs(#0()))) , sub'(@b1, @b2, @r) -> sub'#1(@b1, @b2, @r) , sub#1(tuple#2(@b, @_@1)) -> @b , sub'#1(::(@x, @xs), @b2, @r) -> sub'#2(@b2, @r, @x, @xs) , sub'#1(nil(), @b2, @r) -> tuple#2(nil(), @r) , sub'#2(::(@y, @ys), @r, @x, @xs) -> sub'#3(diff(@x, @y, @r), @xs, @ys) , sub'#2(nil(), @r, @x, @xs) -> tuple#2(nil(), @r) , sub'#3(tuple#2(@z, @r'), @xs, @ys) -> sub'#4(sub'(@xs, @ys, @r'), @z) , sub'#4(tuple#2(@zs, @s), @z) -> tuple#2(sub'#5(#equal(@s, #pos(#s(#0()))), @z, @zs), @s) , sub'#5(#false(), @z, @zs) -> ::(@z, @zs) , sub'#5(#true(), @z, @zs) -> ::(#abs(#0()), @zs) , sum#1(@s) -> sum#2(#equal(@s, #0()), @s) , sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s) , sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0())) , sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0()))))) , sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0())) , sum#4(#false()) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0())))) , sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0())))) , #pred(#0()) -> #neg(#s(#0())) , #pred(#neg(#s(@x))) -> #neg(#s(#s(@x))) , #pred(#pos(#s(#0()))) -> #0() , #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x)) , #succ(#0()) -> #pos(#s(#0())) , #succ(#neg(#s(#0()))) -> #0() , #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x)) , #succ(#pos(#s(@x))) -> #pos(#s(#s(@x))) , #and(#false(), #false()) -> #false() , #and(#false(), #true()) -> #false() , #and(#true(), #false()) -> #false() , #and(#true(), #true()) -> #true() , #natdiv(#0(), #0()) -> #divByZero() , #natdiv(#0(), #s(@y)) -> #0() , #natdiv(#s(@x), #0()) -> #divByZero() , #natdiv(#s(@x), #s(@y)) -> #natdiv'(#divsub(@x, @y), #s(@y)) , #positive(#0()) -> #0() , #positive(#neg(@x)) -> #neg(@x) , #positive(#pos(@x)) -> #pos(@x) , #positive(#s(@x)) -> #pos(#s(@x)) , #negative(#0()) -> #0() , #negative(#neg(@x)) -> #pos(@x) , #negative(#pos(@x)) -> #neg(@x) , #negative(#s(@x)) -> #neg(#s(@x)) , #divsub(#0(), #0()) -> #0() , #divsub(#0(), #s(@y)) -> #underflow() , #divsub(#s(@x), #0()) -> #s(@x) , #divsub(#s(@x), #s(@y)) -> #divsub(@x, @y) , #natmult(#0(), @y) -> #0() , #natmult(#s(@x), @y) -> #natadd(@y, #natmult(@x, @y)) , #natadd(#0(), @y) -> @y , #natadd(#s(@x), @y) -> #s(#natadd(@x, @y)) , #natdiv'(#0(), @y) -> #s(#0()) , #natdiv'(#s(@x), @y) -> #s(#natdiv(#s(@x), @y)) , #natdiv'(#underflow(), @y) -> #0() , #natsub(@x, #0()) -> @x , #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^1)) The following weak DPs constitute a sub-graph of the DG that is closed under successors. The DPs are removed. { compare^#(@b1, @b2) -> c_9(compare#1^#(@b1, @b2)) , compare#1^#(::(@x, @xs), @b2) -> c_10(compare#2^#(@b2, @x, @xs)) , compare#2^#(::(@y, @ys), @x, @xs) -> c_11(compare^#(@xs, @ys)) , leq^#(@b1, @b2) -> c_12(compare^#(@b1, @b2)) } We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^1)). Strict DPs: { sub^#(@b1, @b2) -> c_18(sub'^#(@b1, @b2, #abs(#0()))) , sub'^#(@b1, @b2, @r) -> c_19(sub'#1^#(@b1, @b2, @r)) , sub'#1^#(::(@x, @xs), @b2, @r) -> c_20(sub'#2^#(@b2, @r, @x, @xs)) , sub'#2^#(::(@y, @ys), @r, @x, @xs) -> c_21(sub'#3^#(diff(@x, @y, @r), @xs, @ys)) , sub'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_22(sub'^#(@xs, @ys, @r')) } Weak Trs: { #abs(#0()) -> #0() , #abs(#neg(@x)) -> #pos(@x) , #abs(#pos(@x)) -> #pos(@x) , #abs(#s(@x)) -> #pos(#s(@x)) , #equal(@x, @y) -> #eq(@x, @y) , #eq(#0(), #0()) -> #true() , #eq(#0(), #neg(@y)) -> #false() , #eq(#0(), #pos(@y)) -> #false() , #eq(#0(), #s(@y)) -> #false() , #eq(#neg(@x), #0()) -> #false() , #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #pos(@y)) -> #false() , #eq(#pos(@x), #0()) -> #false() , #eq(#pos(@x), #neg(@y)) -> #false() , #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y) , #eq(#s(@x), #0()) -> #false() , #eq(#s(@x), #s(@y)) -> #eq(@x, @y) , #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #eq(::(@x_1, @x_2), nil()) -> #false() , #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false() , #eq(nil(), ::(@y_1, @y_2)) -> #false() , #eq(nil(), nil()) -> #true() , #eq(nil(), tuple#2(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false() , #eq(tuple#2(@x_1, @x_2), nil()) -> #false() , #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #greater(@x, @y) -> #ckgt(#compare(@x, @y)) , #compare(#0(), #0()) -> #EQ() , #compare(#0(), #neg(@y)) -> #GT() , #compare(#0(), #pos(@y)) -> #LT() , #compare(#0(), #s(@y)) -> #LT() , #compare(#neg(@x), #0()) -> #LT() , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x) , #compare(#neg(@x), #pos(@y)) -> #LT() , #compare(#pos(@x), #0()) -> #GT() , #compare(#pos(@x), #neg(@y)) -> #GT() , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y) , #compare(#s(@x), #0()) -> #GT() , #compare(#s(@x), #s(@y)) -> #compare(@x, @y) , #ckgt(#EQ()) -> #false() , #ckgt(#GT()) -> #true() , #ckgt(#LT()) -> #false() , #less(@x, @y) -> #cklt(#compare(@x, @y)) , #cklt(#EQ()) -> #false() , #cklt(#GT()) -> #false() , #cklt(#LT()) -> #true() , *(@x, @y) -> #mult(@x, @y) , #mult(#0(), #0()) -> #0() , #mult(#0(), #neg(@y)) -> #0() , #mult(#0(), #pos(@y)) -> #0() , #mult(#neg(@x), #0()) -> #0() , #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y)) , #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #0()) -> #0() , #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y)) , +(@x, @y) -> #add(@x, @y) , #add(#0(), @y) -> @y , #add(#neg(#s(#0())), @y) -> #pred(@y) , #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y)) , #add(#pos(#s(#0())), @y) -> #succ(@y) , #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y)) , -(@x, @y) -> #sub(@x, @y) , #sub(@x, #0()) -> @x , #sub(@x, #neg(@y)) -> #add(@x, #pos(@y)) , #sub(@x, #pos(@y)) -> #add(@x, #neg(@y)) , add(@b1, @b2) -> add'(@b1, @b2, #abs(#0())) , add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r) , add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs) , add'#1(nil(), @b2, @r) -> nil() , add'#2(::(@y, @ys), @r, @x, @xs) -> add'#3(sum(@x, @y, @r), @xs, @ys) , add'#2(nil(), @r, @x, @xs) -> nil() , sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r)) , add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r')) , bitToInt(@b) -> bitToInt'(@b, #abs(#pos(#s(#0())))) , bitToInt'(@b, @n) -> bitToInt'#1(@b, @n) , bitToInt'#1(::(@x, @xs), @n) -> +(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))) , bitToInt'#1(nil(), @n) -> #abs(#0()) , compare(@b1, @b2) -> compare#1(@b1, @b2) , compare#1(::(@x, @xs), @b2) -> compare#2(@b2, @x, @xs) , compare#1(nil(), @b2) -> #abs(#0()) , compare#2(::(@y, @ys), @x, @xs) -> compare#3(compare(@xs, @ys), @x, @y) , compare#2(nil(), @x, @xs) -> #abs(#0()) , compare#3(@r, @x, @y) -> compare#4(#equal(@r, #0()), @r, @x, @y) , compare#4(#false(), @r, @x, @y) -> @r , compare#4(#true(), @r, @x, @y) -> compare#5(#less(@x, @y), @x, @y) , compare#5(#false(), @x, @y) -> compare#6(#greater(@x, @y)) , compare#5(#true(), @x, @y) -> -(#0(), #pos(#s(#0()))) , compare#6(#false()) -> #abs(#0()) , compare#6(#true()) -> #abs(#pos(#s(#0()))) , diff(@x, @y, @r) -> tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))), diff#1(#less(-(-(@x, @y), @r), #0()))) , mod(@x, @y) -> -(@x, *(@y, div(@x, @y))) , diff#1(#false()) -> #abs(#0()) , diff#1(#true()) -> #abs(#pos(#s(#0()))) , div(@x, @y) -> #div(@x, @y) , #div(#0(), #0()) -> #divByZero() , #div(#0(), #neg(@y)) -> #0() , #div(#0(), #pos(@y)) -> #0() , #div(#neg(@x), #0()) -> #divByZero() , #div(#neg(@x), #neg(@y)) -> #positive(#natdiv(@x, @y)) , #div(#neg(@x), #pos(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #0()) -> #divByZero() , #div(#pos(@x), #neg(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #pos(@y)) -> #positive(#natdiv(@x, @y)) , leq(@b1, @b2) -> #less(compare(@b1, @b2), #pos(#s(#0()))) , mult(@b1, @b2) -> mult#1(@b1, @b2) , mult#1(::(@x, @xs), @b2) -> mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x) , mult#1(nil(), @b2) -> nil() , mult#2(@zs, @b2, @x) -> mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs) , mult#3(#false(), @b2, @zs) -> @zs , mult#3(#true(), @b2, @zs) -> add(@b2, @zs) , mult3(@b1, @b2, @b3) -> mult(mult(@b1, @b2), @b2) , sub(@b1, @b2) -> sub#1(sub'(@b1, @b2, #abs(#0()))) , sub'(@b1, @b2, @r) -> sub'#1(@b1, @b2, @r) , sub#1(tuple#2(@b, @_@1)) -> @b , sub'#1(::(@x, @xs), @b2, @r) -> sub'#2(@b2, @r, @x, @xs) , sub'#1(nil(), @b2, @r) -> tuple#2(nil(), @r) , sub'#2(::(@y, @ys), @r, @x, @xs) -> sub'#3(diff(@x, @y, @r), @xs, @ys) , sub'#2(nil(), @r, @x, @xs) -> tuple#2(nil(), @r) , sub'#3(tuple#2(@z, @r'), @xs, @ys) -> sub'#4(sub'(@xs, @ys, @r'), @z) , sub'#4(tuple#2(@zs, @s), @z) -> tuple#2(sub'#5(#equal(@s, #pos(#s(#0()))), @z, @zs), @s) , sub'#5(#false(), @z, @zs) -> ::(@z, @zs) , sub'#5(#true(), @z, @zs) -> ::(#abs(#0()), @zs) , sum#1(@s) -> sum#2(#equal(@s, #0()), @s) , sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s) , sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0())) , sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0()))))) , sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0())) , sum#4(#false()) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0())))) , sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0())))) , #pred(#0()) -> #neg(#s(#0())) , #pred(#neg(#s(@x))) -> #neg(#s(#s(@x))) , #pred(#pos(#s(#0()))) -> #0() , #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x)) , #succ(#0()) -> #pos(#s(#0())) , #succ(#neg(#s(#0()))) -> #0() , #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x)) , #succ(#pos(#s(@x))) -> #pos(#s(#s(@x))) , #and(#false(), #false()) -> #false() , #and(#false(), #true()) -> #false() , #and(#true(), #false()) -> #false() , #and(#true(), #true()) -> #true() , #natdiv(#0(), #0()) -> #divByZero() , #natdiv(#0(), #s(@y)) -> #0() , #natdiv(#s(@x), #0()) -> #divByZero() , #natdiv(#s(@x), #s(@y)) -> #natdiv'(#divsub(@x, @y), #s(@y)) , #positive(#0()) -> #0() , #positive(#neg(@x)) -> #neg(@x) , #positive(#pos(@x)) -> #pos(@x) , #positive(#s(@x)) -> #pos(#s(@x)) , #negative(#0()) -> #0() , #negative(#neg(@x)) -> #pos(@x) , #negative(#pos(@x)) -> #neg(@x) , #negative(#s(@x)) -> #neg(#s(@x)) , #divsub(#0(), #0()) -> #0() , #divsub(#0(), #s(@y)) -> #underflow() , #divsub(#s(@x), #0()) -> #s(@x) , #divsub(#s(@x), #s(@y)) -> #divsub(@x, @y) , #natmult(#0(), @y) -> #0() , #natmult(#s(@x), @y) -> #natadd(@y, #natmult(@x, @y)) , #natadd(#0(), @y) -> @y , #natadd(#s(@x), @y) -> #s(#natadd(@x, @y)) , #natdiv'(#0(), @y) -> #s(#0()) , #natdiv'(#s(@x), @y) -> #s(#natdiv(#s(@x), @y)) , #natdiv'(#underflow(), @y) -> #0() , #natsub(@x, #0()) -> @x , #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^1)) We replace rewrite rules by usable rules: Weak Usable Rules: { #abs(#0()) -> #0() , #abs(#neg(@x)) -> #pos(@x) , #abs(#pos(@x)) -> #pos(@x) , #abs(#s(@x)) -> #pos(#s(@x)) , #compare(#0(), #0()) -> #EQ() , #compare(#0(), #neg(@y)) -> #GT() , #compare(#0(), #pos(@y)) -> #LT() , #compare(#0(), #s(@y)) -> #LT() , #compare(#neg(@x), #0()) -> #LT() , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x) , #compare(#neg(@x), #pos(@y)) -> #LT() , #compare(#pos(@x), #0()) -> #GT() , #compare(#pos(@x), #neg(@y)) -> #GT() , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y) , #compare(#s(@x), #0()) -> #GT() , #compare(#s(@x), #s(@y)) -> #compare(@x, @y) , #less(@x, @y) -> #cklt(#compare(@x, @y)) , #cklt(#EQ()) -> #false() , #cklt(#GT()) -> #false() , #cklt(#LT()) -> #true() , *(@x, @y) -> #mult(@x, @y) , #mult(#0(), #0()) -> #0() , #mult(#0(), #neg(@y)) -> #0() , #mult(#0(), #pos(@y)) -> #0() , #mult(#neg(@x), #0()) -> #0() , #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y)) , #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #0()) -> #0() , #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y)) , +(@x, @y) -> #add(@x, @y) , #add(#0(), @y) -> @y , #add(#neg(#s(#0())), @y) -> #pred(@y) , #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y)) , #add(#pos(#s(#0())), @y) -> #succ(@y) , #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y)) , -(@x, @y) -> #sub(@x, @y) , #sub(@x, #0()) -> @x , #sub(@x, #neg(@y)) -> #add(@x, #pos(@y)) , #sub(@x, #pos(@y)) -> #add(@x, #neg(@y)) , diff(@x, @y, @r) -> tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))), diff#1(#less(-(-(@x, @y), @r), #0()))) , mod(@x, @y) -> -(@x, *(@y, div(@x, @y))) , diff#1(#false()) -> #abs(#0()) , diff#1(#true()) -> #abs(#pos(#s(#0()))) , div(@x, @y) -> #div(@x, @y) , #div(#0(), #0()) -> #divByZero() , #div(#0(), #neg(@y)) -> #0() , #div(#0(), #pos(@y)) -> #0() , #div(#neg(@x), #0()) -> #divByZero() , #div(#neg(@x), #neg(@y)) -> #positive(#natdiv(@x, @y)) , #div(#neg(@x), #pos(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #0()) -> #divByZero() , #div(#pos(@x), #neg(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #pos(@y)) -> #positive(#natdiv(@x, @y)) , #pred(#0()) -> #neg(#s(#0())) , #pred(#neg(#s(@x))) -> #neg(#s(#s(@x))) , #pred(#pos(#s(#0()))) -> #0() , #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x)) , #succ(#0()) -> #pos(#s(#0())) , #succ(#neg(#s(#0()))) -> #0() , #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x)) , #succ(#pos(#s(@x))) -> #pos(#s(#s(@x))) , #natdiv(#0(), #0()) -> #divByZero() , #natdiv(#0(), #s(@y)) -> #0() , #natdiv(#s(@x), #0()) -> #divByZero() , #natdiv(#s(@x), #s(@y)) -> #natdiv'(#divsub(@x, @y), #s(@y)) , #positive(#0()) -> #0() , #positive(#neg(@x)) -> #neg(@x) , #positive(#pos(@x)) -> #pos(@x) , #positive(#s(@x)) -> #pos(#s(@x)) , #negative(#0()) -> #0() , #negative(#neg(@x)) -> #pos(@x) , #negative(#pos(@x)) -> #neg(@x) , #negative(#s(@x)) -> #neg(#s(@x)) , #divsub(#0(), #0()) -> #0() , #divsub(#0(), #s(@y)) -> #underflow() , #divsub(#s(@x), #0()) -> #s(@x) , #divsub(#s(@x), #s(@y)) -> #divsub(@x, @y) , #natmult(#0(), @y) -> #0() , #natmult(#s(@x), @y) -> #natadd(@y, #natmult(@x, @y)) , #natadd(#0(), @y) -> @y , #natadd(#s(@x), @y) -> #s(#natadd(@x, @y)) , #natdiv'(#0(), @y) -> #s(#0()) , #natdiv'(#s(@x), @y) -> #s(#natdiv(#s(@x), @y)) , #natdiv'(#underflow(), @y) -> #0() } We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^1)). Strict DPs: { sub^#(@b1, @b2) -> c_18(sub'^#(@b1, @b2, #abs(#0()))) , sub'^#(@b1, @b2, @r) -> c_19(sub'#1^#(@b1, @b2, @r)) , sub'#1^#(::(@x, @xs), @b2, @r) -> c_20(sub'#2^#(@b2, @r, @x, @xs)) , sub'#2^#(::(@y, @ys), @r, @x, @xs) -> c_21(sub'#3^#(diff(@x, @y, @r), @xs, @ys)) , sub'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_22(sub'^#(@xs, @ys, @r')) } Weak Trs: { #abs(#0()) -> #0() , #abs(#neg(@x)) -> #pos(@x) , #abs(#pos(@x)) -> #pos(@x) , #abs(#s(@x)) -> #pos(#s(@x)) , #compare(#0(), #0()) -> #EQ() , #compare(#0(), #neg(@y)) -> #GT() , #compare(#0(), #pos(@y)) -> #LT() , #compare(#0(), #s(@y)) -> #LT() , #compare(#neg(@x), #0()) -> #LT() , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x) , #compare(#neg(@x), #pos(@y)) -> #LT() , #compare(#pos(@x), #0()) -> #GT() , #compare(#pos(@x), #neg(@y)) -> #GT() , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y) , #compare(#s(@x), #0()) -> #GT() , #compare(#s(@x), #s(@y)) -> #compare(@x, @y) , #less(@x, @y) -> #cklt(#compare(@x, @y)) , #cklt(#EQ()) -> #false() , #cklt(#GT()) -> #false() , #cklt(#LT()) -> #true() , *(@x, @y) -> #mult(@x, @y) , #mult(#0(), #0()) -> #0() , #mult(#0(), #neg(@y)) -> #0() , #mult(#0(), #pos(@y)) -> #0() , #mult(#neg(@x), #0()) -> #0() , #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y)) , #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #0()) -> #0() , #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y)) , +(@x, @y) -> #add(@x, @y) , #add(#0(), @y) -> @y , #add(#neg(#s(#0())), @y) -> #pred(@y) , #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y)) , #add(#pos(#s(#0())), @y) -> #succ(@y) , #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y)) , -(@x, @y) -> #sub(@x, @y) , #sub(@x, #0()) -> @x , #sub(@x, #neg(@y)) -> #add(@x, #pos(@y)) , #sub(@x, #pos(@y)) -> #add(@x, #neg(@y)) , diff(@x, @y, @r) -> tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))), diff#1(#less(-(-(@x, @y), @r), #0()))) , mod(@x, @y) -> -(@x, *(@y, div(@x, @y))) , diff#1(#false()) -> #abs(#0()) , diff#1(#true()) -> #abs(#pos(#s(#0()))) , div(@x, @y) -> #div(@x, @y) , #div(#0(), #0()) -> #divByZero() , #div(#0(), #neg(@y)) -> #0() , #div(#0(), #pos(@y)) -> #0() , #div(#neg(@x), #0()) -> #divByZero() , #div(#neg(@x), #neg(@y)) -> #positive(#natdiv(@x, @y)) , #div(#neg(@x), #pos(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #0()) -> #divByZero() , #div(#pos(@x), #neg(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #pos(@y)) -> #positive(#natdiv(@x, @y)) , #pred(#0()) -> #neg(#s(#0())) , #pred(#neg(#s(@x))) -> #neg(#s(#s(@x))) , #pred(#pos(#s(#0()))) -> #0() , #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x)) , #succ(#0()) -> #pos(#s(#0())) , #succ(#neg(#s(#0()))) -> #0() , #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x)) , #succ(#pos(#s(@x))) -> #pos(#s(#s(@x))) , #natdiv(#0(), #0()) -> #divByZero() , #natdiv(#0(), #s(@y)) -> #0() , #natdiv(#s(@x), #0()) -> #divByZero() , #natdiv(#s(@x), #s(@y)) -> #natdiv'(#divsub(@x, @y), #s(@y)) , #positive(#0()) -> #0() , #positive(#neg(@x)) -> #neg(@x) , #positive(#pos(@x)) -> #pos(@x) , #positive(#s(@x)) -> #pos(#s(@x)) , #negative(#0()) -> #0() , #negative(#neg(@x)) -> #pos(@x) , #negative(#pos(@x)) -> #neg(@x) , #negative(#s(@x)) -> #neg(#s(@x)) , #divsub(#0(), #0()) -> #0() , #divsub(#0(), #s(@y)) -> #underflow() , #divsub(#s(@x), #0()) -> #s(@x) , #divsub(#s(@x), #s(@y)) -> #divsub(@x, @y) , #natmult(#0(), @y) -> #0() , #natmult(#s(@x), @y) -> #natadd(@y, #natmult(@x, @y)) , #natadd(#0(), @y) -> @y , #natadd(#s(@x), @y) -> #s(#natadd(@x, @y)) , #natdiv'(#0(), @y) -> #s(#0()) , #natdiv'(#s(@x), @y) -> #s(#natdiv(#s(@x), @y)) , #natdiv'(#underflow(), @y) -> #0() } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^1)) We use the processor 'matrix interpretation of dimension 1' to orient following rules strictly. DPs: { 1: sub^#(@b1, @b2) -> c_18(sub'^#(@b1, @b2, #abs(#0()))) , 3: sub'#1^#(::(@x, @xs), @b2, @r) -> c_20(sub'#2^#(@b2, @r, @x, @xs)) , 4: sub'#2^#(::(@y, @ys), @r, @x, @xs) -> c_21(sub'#3^#(diff(@x, @y, @r), @xs, @ys)) } Trs: { #cklt(#EQ()) -> #false() , #cklt(#GT()) -> #false() , #cklt(#LT()) -> #true() , #sub(@x, #0()) -> @x , #sub(@x, #neg(@y)) -> #add(@x, #pos(@y)) , #sub(@x, #pos(@y)) -> #add(@x, #neg(@y)) , #divsub(#0(), #s(@y)) -> #underflow() } Sub-proof: ---------- The following argument positions are usable: Uargs(c_18) = {1}, Uargs(c_19) = {1}, Uargs(c_20) = {1}, Uargs(c_21) = {1}, Uargs(c_22) = {1} TcT has computed following constructor-based matrix interpretation satisfying not(EDA). [#0] = [1] [#abs](x1) = [0] [#neg](x1) = [0] [#pos](x1) = [0] [#s](x1) = [1] x1 + [0] [#compare](x1, x2) = [0] [#less](x1, x2) = [1] [#cklt](x1) = [1] [*](x1, x2) = [0] [#mult](x1, x2) = [0] [+](x1, x2) = [0] [#add](x1, x2) = [0] [-](x1, x2) = [1] [#sub](x1, x2) = [1] x1 + [1] x2 + [1] [::](x1, x2) = [1] x1 + [1] x2 + [1] [nil] = [0] [tuple#2](x1, x2) = [1] x1 + [1] x2 + [0] [#false] = [0] [#true] = [0] [diff](x1, x2, x3) = [1] [mod](x1, x2) = [1] x1 + [0] [diff#1](x1) = [1] x1 + [0] [div](x1, x2) = [0] [#div](x1, x2) = [0] [#pred](x1) = [0] [#succ](x1) = [0] [#EQ] = [0] [#GT] = [0] [#LT] = [0] [#divByZero] = [0] [#natdiv](x1, x2) = [0] [#positive](x1) = [0] [#negative](x1) = [0] [#divsub](x1, x2) = [1] [#underflow] = [0] [#natmult](x1, x2) = [0] [#natadd](x1, x2) = [0] [#natdiv'](x1, x2) = [0] [#abs^#](x1) = [0] [#equal^#](x1, x2) = [0] [#eq^#](x1, x2) = [0] [#greater^#](x1, x2) = [0] [#ckgt^#](x1) = [0] [#compare^#](x1, x2) = [0] [#less^#](x1, x2) = [0] [#cklt^#](x1) = [0] [*^#](x1, x2) = [0] [#mult^#](x1, x2) = [0] [+^#](x1, x2) = [0] [#add^#](x1, x2) = [0] [-^#](x1, x2) = [0] [#sub^#](x1, x2) = [0] [add^#](x1, x2) = [0] [add'^#](x1, x2, x3) = [0] [add'#1^#](x1, x2, x3) = [0] [add'#2^#](x1, x2, x3, x4) = [0] [add'#3^#](x1, x2, x3) = [0] [sum^#](x1, x2, x3) = [0] [sum#1^#](x1) = [0] [bitToInt^#](x1) = [0] [bitToInt'^#](x1, x2) = [0] [bitToInt'#1^#](x1, x2) = [0] [compare^#](x1, x2) = [0] [compare#1^#](x1, x2) = [0] [compare#2^#](x1, x2, x3) = [0] [compare#3^#](x1, x2, x3) = [0] [compare#4^#](x1, x2, x3, x4) = [0] [compare#5^#](x1, x2, x3) = [0] [compare#6^#](x1) = [0] [diff^#](x1, x2, x3) = [0] [mod^#](x1, x2) = [0] [diff#1^#](x1) = [0] [div^#](x1, x2) = [0] [#div^#](x1, x2) = [0] [leq^#](x1, x2) = [0] [mult^#](x1, x2) = [0] [mult#1^#](x1, x2) = [0] [mult#2^#](x1, x2, x3) = [0] [mult#3^#](x1, x2, x3) = [0] [mult3^#](x1, x2, x3) = [0] [sub^#](x1, x2) = [1] x1 + [1] x2 + [1] [sub#1^#](x1) = [0] [sub'^#](x1, x2, x3) = [1] x1 + [1] x2 + [0] [sub'#1^#](x1, x2, x3) = [1] x1 + [1] x2 + [0] [sub'#2^#](x1, x2, x3, x4) = [1] x1 + [1] x4 + [0] [sub'#3^#](x1, x2, x3) = [1] x2 + [1] x3 + [0] [sub'#4^#](x1, x2) = [0] [sub'#5^#](x1, x2, x3) = [0] [sum#2^#](x1, x2) = [0] [sum#3^#](x1, x2) = [0] [sum#4^#](x1) = [0] [#and^#](x1, x2) = [0] [#natmult^#](x1, x2) = [0] [#pred^#](x1) = [0] [#succ^#](x1) = [0] [#positive^#](x1) = [0] [#natdiv^#](x1, x2) = [0] [#negative^#](x1) = [0] [#natdiv'^#](x1, x2) = [0] [#divsub^#](x1, x2) = [0] [#natadd^#](x1, x2) = [0] [#natsub^#](x1, x2) = [0] [c_18](x1) = [1] x1 + [0] [c_19](x1) = [1] x1 + [0] [c_20](x1) = [1] x1 + [0] [c_21](x1) = [1] x1 + [0] [c_22](x1) = [1] x1 + [0] This order satisfies following ordering constraints [sub^#(@b1, @b2)] = [1] @b1 + [1] @b2 + [1] > [1] @b1 + [1] @b2 + [0] = [c_18(sub'^#(@b1, @b2, #abs(#0())))] [sub'^#(@b1, @b2, @r)] = [1] @b1 + [1] @b2 + [0] >= [1] @b1 + [1] @b2 + [0] = [c_19(sub'#1^#(@b1, @b2, @r))] [sub'#1^#(::(@x, @xs), @b2, @r)] = [1] @b2 + [1] @x + [1] @xs + [1] > [1] @b2 + [1] @xs + [0] = [c_20(sub'#2^#(@b2, @r, @x, @xs))] [sub'#2^#(::(@y, @ys), @r, @x, @xs)] = [1] @xs + [1] @y + [1] @ys + [1] > [1] @xs + [1] @ys + [0] = [c_21(sub'#3^#(diff(@x, @y, @r), @xs, @ys))] [sub'#3^#(tuple#2(@z, @r'), @xs, @ys)] = [1] @xs + [1] @ys + [0] >= [1] @xs + [1] @ys + [0] = [c_22(sub'^#(@xs, @ys, @r'))] Consider the set of all dependency pairs DPs: { 1: sub^#(@b1, @b2) -> c_18(sub'^#(@b1, @b2, #abs(#0()))) , 2: sub'^#(@b1, @b2, @r) -> c_19(sub'#1^#(@b1, @b2, @r)) , 3: sub'#1^#(::(@x, @xs), @b2, @r) -> c_20(sub'#2^#(@b2, @r, @x, @xs)) , 4: sub'#2^#(::(@y, @ys), @r, @x, @xs) -> c_21(sub'#3^#(diff(@x, @y, @r), @xs, @ys)) , 5: sub'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_22(sub'^#(@xs, @ys, @r')) } Processor 'matrix interpretation of dimension 1' induces the complexity certificate YES(?,O(n^1)) on application of dependency pairs {1,3,4}. These cover all (indirect) predecessors of dependency pairs {1,2,3,4,5}, their number of application is equally bounded. The dependency pairs are shifted into the corresponding weak component(s). We apply the transformation 'removetails' on the sub-problem: Weak DPs: { sub^#(@b1, @b2) -> c_18(sub'^#(@b1, @b2, #abs(#0()))) , sub'^#(@b1, @b2, @r) -> c_19(sub'#1^#(@b1, @b2, @r)) , sub'#1^#(::(@x, @xs), @b2, @r) -> c_20(sub'#2^#(@b2, @r, @x, @xs)) , sub'#2^#(::(@y, @ys), @r, @x, @xs) -> c_21(sub'#3^#(diff(@x, @y, @r), @xs, @ys)) , sub'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_22(sub'^#(@xs, @ys, @r')) } Weak Trs: { #abs(#0()) -> #0() , #abs(#neg(@x)) -> #pos(@x) , #abs(#pos(@x)) -> #pos(@x) , #abs(#s(@x)) -> #pos(#s(@x)) , #compare(#0(), #0()) -> #EQ() , #compare(#0(), #neg(@y)) -> #GT() , #compare(#0(), #pos(@y)) -> #LT() , #compare(#0(), #s(@y)) -> #LT() , #compare(#neg(@x), #0()) -> #LT() , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x) , #compare(#neg(@x), #pos(@y)) -> #LT() , #compare(#pos(@x), #0()) -> #GT() , #compare(#pos(@x), #neg(@y)) -> #GT() , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y) , #compare(#s(@x), #0()) -> #GT() , #compare(#s(@x), #s(@y)) -> #compare(@x, @y) , #less(@x, @y) -> #cklt(#compare(@x, @y)) , #cklt(#EQ()) -> #false() , #cklt(#GT()) -> #false() , #cklt(#LT()) -> #true() , *(@x, @y) -> #mult(@x, @y) , #mult(#0(), #0()) -> #0() , #mult(#0(), #neg(@y)) -> #0() , #mult(#0(), #pos(@y)) -> #0() , #mult(#neg(@x), #0()) -> #0() , #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y)) , #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #0()) -> #0() , #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y)) , +(@x, @y) -> #add(@x, @y) , #add(#0(), @y) -> @y , #add(#neg(#s(#0())), @y) -> #pred(@y) , #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y)) , #add(#pos(#s(#0())), @y) -> #succ(@y) , #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y)) , -(@x, @y) -> #sub(@x, @y) , #sub(@x, #0()) -> @x , #sub(@x, #neg(@y)) -> #add(@x, #pos(@y)) , #sub(@x, #pos(@y)) -> #add(@x, #neg(@y)) , diff(@x, @y, @r) -> tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))), diff#1(#less(-(-(@x, @y), @r), #0()))) , mod(@x, @y) -> -(@x, *(@y, div(@x, @y))) , diff#1(#false()) -> #abs(#0()) , diff#1(#true()) -> #abs(#pos(#s(#0()))) , div(@x, @y) -> #div(@x, @y) , #div(#0(), #0()) -> #divByZero() , #div(#0(), #neg(@y)) -> #0() , #div(#0(), #pos(@y)) -> #0() , #div(#neg(@x), #0()) -> #divByZero() , #div(#neg(@x), #neg(@y)) -> #positive(#natdiv(@x, @y)) , #div(#neg(@x), #pos(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #0()) -> #divByZero() , #div(#pos(@x), #neg(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #pos(@y)) -> #positive(#natdiv(@x, @y)) , #pred(#0()) -> #neg(#s(#0())) , #pred(#neg(#s(@x))) -> #neg(#s(#s(@x))) , #pred(#pos(#s(#0()))) -> #0() , #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x)) , #succ(#0()) -> #pos(#s(#0())) , #succ(#neg(#s(#0()))) -> #0() , #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x)) , #succ(#pos(#s(@x))) -> #pos(#s(#s(@x))) , #natdiv(#0(), #0()) -> #divByZero() , #natdiv(#0(), #s(@y)) -> #0() , #natdiv(#s(@x), #0()) -> #divByZero() , #natdiv(#s(@x), #s(@y)) -> #natdiv'(#divsub(@x, @y), #s(@y)) , #positive(#0()) -> #0() , #positive(#neg(@x)) -> #neg(@x) , #positive(#pos(@x)) -> #pos(@x) , #positive(#s(@x)) -> #pos(#s(@x)) , #negative(#0()) -> #0() , #negative(#neg(@x)) -> #pos(@x) , #negative(#pos(@x)) -> #neg(@x) , #negative(#s(@x)) -> #neg(#s(@x)) , #divsub(#0(), #0()) -> #0() , #divsub(#0(), #s(@y)) -> #underflow() , #divsub(#s(@x), #0()) -> #s(@x) , #divsub(#s(@x), #s(@y)) -> #divsub(@x, @y) , #natmult(#0(), @y) -> #0() , #natmult(#s(@x), @y) -> #natadd(@y, #natmult(@x, @y)) , #natadd(#0(), @y) -> @y , #natadd(#s(@x), @y) -> #s(#natadd(@x, @y)) , #natdiv'(#0(), @y) -> #s(#0()) , #natdiv'(#s(@x), @y) -> #s(#natdiv(#s(@x), @y)) , #natdiv'(#underflow(), @y) -> #0() } StartTerms: basic terms Strategy: innermost The following weak DPs constitute a sub-graph of the DG that is closed under successors. The DPs are removed. { sub^#(@b1, @b2) -> c_18(sub'^#(@b1, @b2, #abs(#0()))) , sub'^#(@b1, @b2, @r) -> c_19(sub'#1^#(@b1, @b2, @r)) , sub'#1^#(::(@x, @xs), @b2, @r) -> c_20(sub'#2^#(@b2, @r, @x, @xs)) , sub'#2^#(::(@y, @ys), @r, @x, @xs) -> c_21(sub'#3^#(diff(@x, @y, @r), @xs, @ys)) , sub'#3^#(tuple#2(@z, @r'), @xs, @ys) -> c_22(sub'^#(@xs, @ys, @r')) } We apply the transformation 'usablerules' on the sub-problem: Weak Trs: { #abs(#0()) -> #0() , #abs(#neg(@x)) -> #pos(@x) , #abs(#pos(@x)) -> #pos(@x) , #abs(#s(@x)) -> #pos(#s(@x)) , #compare(#0(), #0()) -> #EQ() , #compare(#0(), #neg(@y)) -> #GT() , #compare(#0(), #pos(@y)) -> #LT() , #compare(#0(), #s(@y)) -> #LT() , #compare(#neg(@x), #0()) -> #LT() , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x) , #compare(#neg(@x), #pos(@y)) -> #LT() , #compare(#pos(@x), #0()) -> #GT() , #compare(#pos(@x), #neg(@y)) -> #GT() , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y) , #compare(#s(@x), #0()) -> #GT() , #compare(#s(@x), #s(@y)) -> #compare(@x, @y) , #less(@x, @y) -> #cklt(#compare(@x, @y)) , #cklt(#EQ()) -> #false() , #cklt(#GT()) -> #false() , #cklt(#LT()) -> #true() , *(@x, @y) -> #mult(@x, @y) , #mult(#0(), #0()) -> #0() , #mult(#0(), #neg(@y)) -> #0() , #mult(#0(), #pos(@y)) -> #0() , #mult(#neg(@x), #0()) -> #0() , #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y)) , #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #0()) -> #0() , #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y)) , +(@x, @y) -> #add(@x, @y) , #add(#0(), @y) -> @y , #add(#neg(#s(#0())), @y) -> #pred(@y) , #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y)) , #add(#pos(#s(#0())), @y) -> #succ(@y) , #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y)) , -(@x, @y) -> #sub(@x, @y) , #sub(@x, #0()) -> @x , #sub(@x, #neg(@y)) -> #add(@x, #pos(@y)) , #sub(@x, #pos(@y)) -> #add(@x, #neg(@y)) , diff(@x, @y, @r) -> tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))), diff#1(#less(-(-(@x, @y), @r), #0()))) , mod(@x, @y) -> -(@x, *(@y, div(@x, @y))) , diff#1(#false()) -> #abs(#0()) , diff#1(#true()) -> #abs(#pos(#s(#0()))) , div(@x, @y) -> #div(@x, @y) , #div(#0(), #0()) -> #divByZero() , #div(#0(), #neg(@y)) -> #0() , #div(#0(), #pos(@y)) -> #0() , #div(#neg(@x), #0()) -> #divByZero() , #div(#neg(@x), #neg(@y)) -> #positive(#natdiv(@x, @y)) , #div(#neg(@x), #pos(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #0()) -> #divByZero() , #div(#pos(@x), #neg(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #pos(@y)) -> #positive(#natdiv(@x, @y)) , #pred(#0()) -> #neg(#s(#0())) , #pred(#neg(#s(@x))) -> #neg(#s(#s(@x))) , #pred(#pos(#s(#0()))) -> #0() , #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x)) , #succ(#0()) -> #pos(#s(#0())) , #succ(#neg(#s(#0()))) -> #0() , #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x)) , #succ(#pos(#s(@x))) -> #pos(#s(#s(@x))) , #natdiv(#0(), #0()) -> #divByZero() , #natdiv(#0(), #s(@y)) -> #0() , #natdiv(#s(@x), #0()) -> #divByZero() , #natdiv(#s(@x), #s(@y)) -> #natdiv'(#divsub(@x, @y), #s(@y)) , #positive(#0()) -> #0() , #positive(#neg(@x)) -> #neg(@x) , #positive(#pos(@x)) -> #pos(@x) , #positive(#s(@x)) -> #pos(#s(@x)) , #negative(#0()) -> #0() , #negative(#neg(@x)) -> #pos(@x) , #negative(#pos(@x)) -> #neg(@x) , #negative(#s(@x)) -> #neg(#s(@x)) , #divsub(#0(), #0()) -> #0() , #divsub(#0(), #s(@y)) -> #underflow() , #divsub(#s(@x), #0()) -> #s(@x) , #divsub(#s(@x), #s(@y)) -> #divsub(@x, @y) , #natmult(#0(), @y) -> #0() , #natmult(#s(@x), @y) -> #natadd(@y, #natmult(@x, @y)) , #natadd(#0(), @y) -> @y , #natadd(#s(@x), @y) -> #s(#natadd(@x, @y)) , #natdiv'(#0(), @y) -> #s(#0()) , #natdiv'(#s(@x), @y) -> #s(#natdiv(#s(@x), @y)) , #natdiv'(#underflow(), @y) -> #0() } StartTerms: basic terms Strategy: innermost No rule is usable, rules are removed from the input problem. We are left with following problem, upon which TcT provides the certificate YES(O(1),O(1)). Rules: Empty Obligation: innermost runtime complexity Answer: YES(O(1),O(1)) Empty rules are trivially bounded Wall-time: 2.698276s CPU-time: 26.391s Hurray, we answered YES(O(1),O(n^2))